Chatterino
Classes | Public Types | Signals | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
chatterino::Button Class Reference

#include <Button.hpp>

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

Public Types

enum  Dim { Dim::None, Dim::Some, Dim::Lots }
 

Signals

void leftClicked ()
 
void clicked (Qt::MouseButton button)
 
void leftMousePress ()
 

Public Member Functions

 Button (BaseWidget *parent=nullptr)
 
void setMouseEffectColor (boost::optional< QColor > color)
 
void setPixmap (const QPixmap &pixmap_)
 
const QPixmap & getPixmap () const
 
void setDim (Dim value)
 
Dim getDim () const
 
qreal getCurrentDimAmount () const
 
void setEnable (bool value)
 
bool getEnable () const
 
void setEnableMargin (bool value)
 
bool getEnableMargin () const
 
void setBorderColor (const QColor &color)
 
const QColor & getBorderColor () const
 
void setMenu (std::unique_ptr< QMenu > menu)
 
- Public Member Functions inherited from chatterino::BaseWidget
 BaseWidget (QWidget *parent=nullptr, Qt::WindowFlags f=Qt::WindowFlags())
 
virtual float scale () const
 
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
 

Protected Member Functions

virtual void paintEvent (QPaintEvent *) override
 
virtual void enterEvent (QEvent *) override
 
virtual void leaveEvent (QEvent *) override
 
virtual void mousePressEvent (QMouseEvent *event) override
 
virtual void mouseReleaseEvent (QMouseEvent *event) override
 
virtual void mouseMoveEvent (QMouseEvent *event) override
 
void fancyPaint (QPainter &painter)
 
- Protected Member Functions inherited from chatterino::BaseWidget
virtual void childEvent (QChildEvent *) override
 
virtual void showEvent (QShowEvent *) override
 
virtual void scaleChangedEvent (float newScale)
 
virtual void themeChangedEvent ()
 
virtual void addShortcuts ()
 
void setScale (float value)
 
void clearShortcuts ()
 

Protected Attributes

bool enabled_ {true}
 
bool selected_ {false}
 
bool mouseOver_ {false}
 
bool mouseDown_ {false}
 
bool menuVisible_ {false}
 
- Protected Attributes inherited from chatterino::BaseWidget
Themetheme
 
std::vector< QShortcut * > shortcuts_
 
pajlada::Signals::SignalHolder signalHolder_
 

Additional Inherited Members

- Public Attributes inherited from chatterino::BaseWidget
pajlada::Signals::Signal< float > scaleChanged
 

Member Enumeration Documentation

◆ Dim

Enumerator
None 
Some 
Lots 

Constructor & Destructor Documentation

◆ Button()

chatterino::Button::Button ( BaseWidget parent = nullptr)

Member Function Documentation

◆ clicked

void chatterino::Button::clicked ( Qt::MouseButton  button)
signal
Here is the caller graph for this function:

◆ enterEvent()

void chatterino::Button::enterEvent ( QEvent *  )
overrideprotectedvirtual

Reimplemented in chatterino::NotebookTab.

Here is the caller graph for this function:

◆ fancyPaint()

void chatterino::Button::fancyPaint ( QPainter &  painter)
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getBorderColor()

const QColor & chatterino::Button::getBorderColor ( ) const

◆ getCurrentDimAmount()

qreal chatterino::Button::getCurrentDimAmount ( ) const
Here is the caller graph for this function:

◆ getDim()

Button::Dim chatterino::Button::getDim ( ) const

◆ getEnable()

bool chatterino::Button::getEnable ( ) const

◆ getEnableMargin()

bool chatterino::Button::getEnableMargin ( ) const

◆ getPixmap()

const QPixmap & chatterino::Button::getPixmap ( ) const

◆ leaveEvent()

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

Reimplemented in chatterino::NotebookTab.

Here is the caller graph for this function:

◆ leftClicked

void chatterino::Button::leftClicked ( )
signal
Here is the caller graph for this function:

◆ leftMousePress

void chatterino::Button::leftMousePress ( )
signal
Here is the caller graph for this function:

◆ mouseMoveEvent()

void chatterino::Button::mouseMoveEvent ( QMouseEvent *  event)
overrideprotectedvirtual

Reimplemented in chatterino::NotebookTab.

Here is the caller graph for this function:

◆ mousePressEvent()

void chatterino::Button::mousePressEvent ( QMouseEvent *  event)
overrideprotectedvirtual

Reimplemented in chatterino::NotebookTab.

Here is the caller graph for this function:

◆ mouseReleaseEvent()

void chatterino::Button::mouseReleaseEvent ( QMouseEvent *  event)
overrideprotectedvirtual

Reimplemented in chatterino::NotebookTab, and chatterino::NotebookButton.

Here is the caller graph for this function:

◆ paintEvent()

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

Reimplemented in chatterino::NotebookTab, chatterino::TitleBarButton, and chatterino::NotebookButton.

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

◆ setBorderColor()

void chatterino::Button::setBorderColor ( const QColor &  color)

◆ setDim()

void chatterino::Button::setDim ( Dim  value)

◆ setEnable()

void chatterino::Button::setEnable ( bool  value)
Here is the caller graph for this function:

◆ setEnableMargin()

void chatterino::Button::setEnableMargin ( bool  value)

◆ setMenu()

void chatterino::Button::setMenu ( std::unique_ptr< QMenu >  menu)
Here is the caller graph for this function:

◆ setMouseEffectColor()

void chatterino::Button::setMouseEffectColor ( boost::optional< QColor >  color)
Here is the caller graph for this function:

◆ setPixmap()

void chatterino::Button::setPixmap ( const QPixmap &  pixmap_)
Here is the caller graph for this function:

Member Data Documentation

◆ enabled_

bool chatterino::Button::enabled_ {true}
protected

◆ menuVisible_

bool chatterino::Button::menuVisible_ {false}
protected

◆ mouseDown_

bool chatterino::Button::mouseDown_ {false}
protected

◆ mouseOver_

bool chatterino::Button::mouseOver_ {false}
protected

◆ selected_

bool chatterino::Button::selected_ {false}
protected

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