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)
|
TitleBar::TitleBar (QWidget *parent, bool shaded) : PixWidget (parent)
|
||||||
{
|
{
|
||||||
MainWindow *mw = (MainWindow *)((SkinDisplay *)parent)->getMW();
|
m_shaded = shaded;
|
||||||
|
|
||||||
if (shaded) {
|
setMinimumSize(QSize(275, 14));
|
||||||
m_pixmap_active = mw->getSkin()->getItem(Skin::STATUSBAR_0);
|
setMaximumSize(QSize(275, 14));
|
||||||
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 {
|
} else {
|
||||||
m_pixmap_active = mw->getSkin()->getItem(Skin::TITLEBAR_0);
|
m_pixmap_active = skin->getItem(Skin::TITLEBAR_0);
|
||||||
m_pixmap_inactive = mw->getSkin()->getItem(Skin::TITLEBAR_1);
|
m_pixmap_inactive = skin->getItem(Skin::TITLEBAR_1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (underMouse()) {
|
if (underMouse()) {
|
||||||
m_pixmap = m_pixmap_active;
|
m_pixmap = m_pixmap_active;
|
||||||
} else {
|
} else {
|
||||||
m_pixmap = m_pixmap_inactive;
|
m_pixmap = m_pixmap_inactive;
|
||||||
}
|
}
|
||||||
|
|
||||||
qDebug("%d %d", m_pixmap.width(), m_pixmap.height());
|
update ();
|
||||||
|
|
||||||
setMinimumSize(QSize(275, 14));
|
|
||||||
setMaximumSize(QSize(275, 14));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TitleBar::~TitleBar ()
|
TitleBar::~TitleBar ()
|
||||||
|
|
|
@ -13,11 +13,17 @@ class TitleBar : public PixWidget
|
||||||
TitleBar (QWidget *parent, bool shaded);
|
TitleBar (QWidget *parent, bool shaded);
|
||||||
~TitleBar ();
|
~TitleBar ();
|
||||||
void setActive (bool active);
|
void setActive (bool active);
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void setPixmaps (Skin *skin);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void mouseDoubleClickEvent (QMouseEvent *event);
|
void mouseDoubleClickEvent (QMouseEvent *event);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QPixmap m_pixmap_active;
|
QPixmap m_pixmap_active;
|
||||||
QPixmap m_pixmap_inactive;
|
QPixmap m_pixmap_inactive;
|
||||||
|
bool m_shaded;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue