Chatterino
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Friends | List of all members
chatterino::BaseWindow Class Reference

#include <BaseWindow.hpp>

Inheritance diagram for chatterino::BaseWindow:
[legend]
Collaboration diagram for chatterino::BaseWindow:
[legend]

Public Types

enum  Flags {
  None = 0, EnableCustomFrame = 1, Frameless = 2, TopMost = 4,
  DisableCustomScaling = 8, FramelessDraggable = 16, DontFocus = 32, Dialog = 64
}
 
enum  ActionOnFocusLoss { Nothing, Delete, Close, Hide }
 

Public Member Functions

 BaseWindow (FlagsEnum< Flags > flags_=None, QWidget *parent=nullptr)
 
 ~BaseWindow () override
 
void setInitialBounds (const QRect &bounds)
 
QRect getBounds ()
 
QWidget * getLayoutContainer ()
 
bool hasCustomWindowFrame ()
 
TitleBarButtonaddTitleBarButton (const TitleBarButtonStyle &style, std::function< void()> onClicked)
 
EffectLabeladdTitleBarLabel (std::function< void()> onClicked)
 
void setStayInScreenRect (bool value)
 
bool getStayInScreenRect () const
 
void setActionOnFocusLoss (ActionOnFocusLoss value)
 
ActionOnFocusLoss getActionOnFocusLoss () const
 
void moveTo (QWidget *widget, QPoint point, bool offset=true)
 
virtual float scale () const override
 
float qtFontScale () const
 
- Public Member Functions inherited from chatterino::BaseWidget
 BaseWidget (QWidget *parent=nullptr, Qt::WindowFlags f=Qt::WindowFlags())
 
boost::optional< float > overrideScale () const
 
void setOverrideScale (boost::optional< float >)
 
QSize scaleIndependantSize () const
 
int scaleIndependantWidth () const
 
int scaleIndependantHeight () const
 
void setScaleIndependantSize (int width, int height)
 
void setScaleIndependantSize (QSize)
 
void setScaleIndependantWidth (int value)
 
void setScaleIndependantHeight (int value)
 
float qtFontScale () const
 

Static Public Member Functions

static bool supportsCustomWindowFrame ()
 

Public Attributes

pajlada::Signals::NoArgSignal closing
 
QLayout * windowLayout = nullptr
 
QHBoxLayout * titlebarBox = nullptr
 
QWidget * titleLabel = nullptr
 
TitleBarButtonminButton = nullptr
 
TitleBarButtonmaxButton = nullptr
 
TitleBarButtonexitButton = nullptr
 
QWidget * layoutBase = nullptr
 
std::vector< Button * > buttons
 
- Public Attributes inherited from chatterino::BaseWidget
pajlada::Signals::Signal< float > scaleChanged
 

Protected Member Functions

virtual bool nativeEvent (const QByteArray &eventType, void *message, long *result) override
 
virtual void scaleChangedEvent (float) override
 
virtual void paintEvent (QPaintEvent *) override
 
virtual void changeEvent (QEvent *) override
 
virtual void leaveEvent (QEvent *) override
 
virtual void resizeEvent (QResizeEvent *) override
 
virtual void moveEvent (QMoveEvent *) override
 
virtual void closeEvent (QCloseEvent *) override
 
virtual void showEvent (QShowEvent *) override
 
virtual void themeChangedEvent () override
 
virtual bool event (QEvent *event) override
 
virtual void wheelEvent (QWheelEvent *event) override
 
void mousePressEvent (QMouseEvent *event) override
 
void mouseReleaseEvent (QMouseEvent *event) override
 
void mouseMoveEvent (QMouseEvent *event) override
 
void updateScale ()
 
- Protected Member Functions inherited from chatterino::BaseWidget
virtual void childEvent (QChildEvent *) override
 
virtual void addShortcuts ()
 
void setScale (float value)
 
void clearShortcuts ()
 

Protected Attributes

QPointF movingRelativePos
 
bool moving {}
 
boost::optional< QColor > overrideBackgroundColor_
 
- Protected Attributes inherited from chatterino::BaseWidget
Themetheme
 
std::vector< QShortcut * > shortcuts_
 
pajlada::Signals::SignalHolder signalHolder_
 

Friends

class BaseWidget
 

Member Enumeration Documentation

◆ ActionOnFocusLoss

Enumerator
Nothing 
Delete 
Close 
Hide 

◆ Flags

Enumerator
None 
EnableCustomFrame 
Frameless 
TopMost 
DisableCustomScaling 
FramelessDraggable 
DontFocus 
Dialog 

Constructor & Destructor Documentation

◆ BaseWindow()

chatterino::BaseWindow::BaseWindow ( FlagsEnum< Flags flags_ = None,
QWidget *  parent = nullptr 
)
explicit
Here is the call graph for this function:

◆ ~BaseWindow()

chatterino::BaseWindow::~BaseWindow ( )
override
Here is the call graph for this function:

Member Function Documentation

◆ addTitleBarButton()

TitleBarButton * chatterino::BaseWindow::addTitleBarButton ( const TitleBarButtonStyle style,
std::function< void()>  onClicked 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addTitleBarLabel()

EffectLabel * chatterino::BaseWindow::addTitleBarLabel ( std::function< void()>  onClicked)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ changeEvent()

void chatterino::BaseWindow::changeEvent ( QEvent *  )
overrideprotectedvirtual

Reimplemented in chatterino::TooltipWidget.

Here is the call graph for this function:

◆ closeEvent()

void chatterino::BaseWindow::closeEvent ( QCloseEvent *  )
overrideprotectedvirtual

◆ event()

bool chatterino::BaseWindow::event ( QEvent *  event)
overrideprotectedvirtual

Reimplemented in chatterino::Window.

Here is the caller graph for this function:

◆ getActionOnFocusLoss()

BaseWindow::ActionOnFocusLoss chatterino::BaseWindow::getActionOnFocusLoss ( ) const
Here is the caller graph for this function:

◆ getBounds()

QRect chatterino::BaseWindow::getBounds ( )

◆ getLayoutContainer()

QWidget * chatterino::BaseWindow::getLayoutContainer ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getStayInScreenRect()

bool chatterino::BaseWindow::getStayInScreenRect ( ) const

◆ hasCustomWindowFrame()

bool chatterino::BaseWindow::hasCustomWindowFrame ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ leaveEvent()

void chatterino::BaseWindow::leaveEvent ( QEvent *  )
overrideprotectedvirtual

Reimplemented in chatterino::TooltipWidget.

Here is the call graph for this function:

◆ mouseMoveEvent()

void chatterino::BaseWindow::mouseMoveEvent ( QMouseEvent *  event)
overrideprotected
Here is the call graph for this function:

◆ mousePressEvent()

void chatterino::BaseWindow::mousePressEvent ( QMouseEvent *  event)
overrideprotected
Here is the call graph for this function:

◆ mouseReleaseEvent()

void chatterino::BaseWindow::mouseReleaseEvent ( QMouseEvent *  event)
overrideprotected
Here is the call graph for this function:

◆ moveEvent()

void chatterino::BaseWindow::moveEvent ( QMoveEvent *  event)
overrideprotectedvirtual
Here is the call graph for this function:

◆ moveTo()

void chatterino::BaseWindow::moveTo ( QWidget *  widget,
QPoint  point,
bool  offset = true 
)
Here is the caller graph for this function:

◆ nativeEvent()

bool chatterino::BaseWindow::nativeEvent ( const QByteArray &  eventType,
void *  message,
long *  result 
)
overrideprotectedvirtual
Here is the caller graph for this function:

◆ paintEvent()

void chatterino::BaseWindow::paintEvent ( QPaintEvent *  )
overrideprotectedvirtual

◆ qtFontScale()

float chatterino::BaseWindow::qtFontScale ( ) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ resizeEvent()

void chatterino::BaseWindow::resizeEvent ( QResizeEvent *  )
overrideprotectedvirtual
Here is the call graph for this function:

◆ scale()

float chatterino::BaseWindow::scale ( ) const
overridevirtual

Reimplemented from chatterino::BaseWidget.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ scaleChangedEvent()

void chatterino::BaseWindow::scaleChangedEvent ( float  scale)
overrideprotectedvirtual

Reimplemented from chatterino::BaseWidget.

Reimplemented in chatterino::SettingsDialog, chatterino::TooltipWidget, and chatterino::UserInfoPopup.

Here is the call graph for this function:

◆ setActionOnFocusLoss()

void chatterino::BaseWindow::setActionOnFocusLoss ( ActionOnFocusLoss  value)
Here is the caller graph for this function:

◆ setInitialBounds()

void chatterino::BaseWindow::setInitialBounds ( const QRect &  bounds)
Here is the caller graph for this function:

◆ setStayInScreenRect()

void chatterino::BaseWindow::setStayInScreenRect ( bool  value)
Here is the caller graph for this function:

◆ showEvent()

void chatterino::BaseWindow::showEvent ( QShowEvent *  )
overrideprotectedvirtual

Reimplemented from chatterino::BaseWidget.

Reimplemented in chatterino::SettingsDialog, chatterino::SearchPopup, and chatterino::InputCompletionPopup.

Here is the caller graph for this function:

◆ supportsCustomWindowFrame()

bool chatterino::BaseWindow::supportsCustomWindowFrame ( )
static
Here is the caller graph for this function:

◆ themeChangedEvent()

void chatterino::BaseWindow::themeChangedEvent ( )
overrideprotectedvirtual

Reimplemented from chatterino::BaseWidget.

Reimplemented in chatterino::ColorPickerDialog, chatterino::SettingsDialog, chatterino::TooltipWidget, chatterino::SelectChannelDialog, chatterino::UserInfoPopup, and chatterino::QuickSwitcherPopup.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateScale()

void chatterino::BaseWindow::updateScale ( )
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wheelEvent()

void chatterino::BaseWindow::wheelEvent ( QWheelEvent *  event)
overrideprotectedvirtual
Here is the call graph for this function:

Friends And Related Function Documentation

◆ BaseWidget

friend class BaseWidget
friend

Member Data Documentation

◆ buttons

std::vector<Button *> chatterino::BaseWindow::buttons

◆ closing

pajlada::Signals::NoArgSignal chatterino::BaseWindow::closing

◆ exitButton

TitleBarButton* chatterino::BaseWindow::exitButton = nullptr

◆ layoutBase

QWidget* chatterino::BaseWindow::layoutBase = nullptr

◆ maxButton

TitleBarButton* chatterino::BaseWindow::maxButton = nullptr

◆ minButton

TitleBarButton* chatterino::BaseWindow::minButton = nullptr

◆ moving

bool chatterino::BaseWindow::moving {}
protected

◆ movingRelativePos

QPointF chatterino::BaseWindow::movingRelativePos
protected

◆ overrideBackgroundColor_

boost::optional<QColor> chatterino::BaseWindow::overrideBackgroundColor_
protected

◆ titlebarBox

QHBoxLayout* chatterino::BaseWindow::titlebarBox = nullptr

◆ titleLabel

QWidget* chatterino::BaseWindow::titleLabel = nullptr

◆ windowLayout

QLayout* chatterino::BaseWindow::windowLayout = nullptr

The documentation for this class was generated from the following files: