Fixed titlebars
This commit is contained in:
parent
1013c8dbeb
commit
a709689b3d
2 changed files with 20 additions and 11 deletions
25
TitleBar.cpp
25
TitleBar.cpp
|
@ -4,27 +4,30 @@
|
|||
|
||||
TitleBar::TitleBar (QWidget *parent, bool shaded) : PixWidget (parent)
|
||||
{
|
||||
MainWindow *mw = (MainWindow *)((SkinDisplay *)parent)->getMW();
|
||||
m_shaded = shaded;
|
||||
|
||||
setMinimumSize(QSize(275, 14));
|
||||
setMaximumSize(QSize(275, 14));
|
||||
}
|
||||
|
||||
if (shaded) {
|
||||
m_pixmap_active = mw->getSkin()->getItem(Skin::STATUSBAR_0);
|
||||
m_pixmap_inactive = mw->getSkin()->getItem(Skin::STATUSBAR_1);
|
||||
void
|
||||
TitleBar::setPixmaps (Skin *skin)
|
||||
{
|
||||
if (m_shaded) {
|
||||
m_pixmap_active = skin->getItem(Skin::STATUSBAR_0);
|
||||
m_pixmap_inactive = skin->getItem(Skin::STATUSBAR_1);
|
||||
} else {
|
||||
m_pixmap_active = mw->getSkin()->getItem(Skin::TITLEBAR_0);
|
||||
m_pixmap_inactive = mw->getSkin()->getItem(Skin::TITLEBAR_1);
|
||||
m_pixmap_active = skin->getItem(Skin::TITLEBAR_0);
|
||||
m_pixmap_inactive = skin->getItem(Skin::TITLEBAR_1);
|
||||
}
|
||||
|
||||
|
||||
if (underMouse()) {
|
||||
m_pixmap = m_pixmap_active;
|
||||
} else {
|
||||
m_pixmap = m_pixmap_inactive;
|
||||
}
|
||||
|
||||
qDebug("%d %d", m_pixmap.width(), m_pixmap.height());
|
||||
|
||||
setMinimumSize(QSize(275, 14));
|
||||
setMaximumSize(QSize(275, 14));
|
||||
update ();
|
||||
}
|
||||
|
||||
TitleBar::~TitleBar ()
|
||||
|
|
|
@ -13,11 +13,17 @@ class TitleBar : public PixWidget
|
|||
TitleBar (QWidget *parent, bool shaded);
|
||||
~TitleBar ();
|
||||
void setActive (bool active);
|
||||
|
||||
public slots:
|
||||
void setPixmaps (Skin *skin);
|
||||
|
||||
protected:
|
||||
void mouseDoubleClickEvent (QMouseEvent *event);
|
||||
|
||||
private:
|
||||
QPixmap m_pixmap_active;
|
||||
QPixmap m_pixmap_inactive;
|
||||
bool m_shaded;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue