diff options
author | unknown <Roopesh Chander@.(none)> | 2009-11-12 23:29:32 +0530 |
---|---|---|
committer | unknown <Roopesh Chander@.(none)> | 2009-11-12 23:59:23 +0530 |
commit | 7902b8b633c7dd41ce457ddbfc783ff54d082c64 (patch) | |
tree | fadf6b926b9e14e5a02f5baf82ed6dc55a03e6cb | |
parent | a3bc0247873b2bbb1053a59230001090a458a42f (diff) |
a more native look for the frame and the edit toolbar of the scraps
-rw-r--r-- | webscrap.cpp | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/webscrap.cpp b/webscrap.cpp index 40afa1f..2ca2056 100644 --- a/webscrap.cpp +++ b/webscrap.cpp @@ -235,14 +235,8 @@ WebScrapContainer::WebScrapContainer(WebScrap *scrap, QGraphicsScene *scene, qre scrap->setParentItem(m_frame); scrap->setPos(s_padding, s_titlePadding); - QLinearGradient gradient; - gradient.setCoordinateMode(QGradient::ObjectBoundingMode); - gradient.setStart(0, 0); - gradient.setFinalStop(0, 1); - gradient.setColorAt(0, Qt::black); - gradient.setColorAt(1, QColor(Qt::gray).lighter(150)); m_frame->setPen(Qt::NoPen); - m_frame->setBrush(gradient); + m_frame->setBrush(palette().background()); m_frame->setFlag(QGraphicsItem::ItemClipsChildrenToShape, true); m_frame->installSceneEventFilter(this); @@ -252,7 +246,7 @@ WebScrapContainer::WebScrapContainer(WebScrap *scrap, QGraphicsScene *scene, qre m_titlebar = new QGraphicsTextItem(m_frame); m_titlebar->setPlainText(scrap->title()); m_titlebar->setPos(10, 0); - m_titlebar->setDefaultTextColor(Qt::gray); + m_titlebar->setDefaultTextColor(palette().color(QPalette::Foreground)); connect(scrap, SIGNAL(titleChanged(QString)), SLOT(setTitle(QString))); // create the tool bar @@ -340,14 +334,7 @@ void WebScrapContainer::createToolbar() { m_toolbar->layout()->activate(); m_toolbar->setPos(m_frame->pos() + m_frame->boundingRect().topRight() - QPointF(m_toolbar->rect().width(), 0)); m_toolbar->setFlag(QGraphicsItem::ItemIsMovable, false); - - QLinearGradient gradient; - gradient.setCoordinateMode(QGradient::ObjectBoundingMode); - gradient.setStart(0, 0); - gradient.setFinalStop(1, 0); - gradient.setColorAt(0, Qt::transparent); - gradient.setColorAt(1, QColor(Qt::black)); - m_toolbar->setBackgroundBrush(gradient); + m_toolbar->setBackgroundBrush(palette().background()); connect(m_closeButton, SIGNAL(clicked()), SLOT(handleCloseButtonClicked())); connect(m_adjustButton, SIGNAL(clicked(bool)), SLOT(handleEditButtonClicked(bool))); @@ -396,6 +383,7 @@ void WebScrapContainer::createEditToolbar() { m_editToolbar->setPos(m_frame->pos() + m_frame->boundingRect().topRight() - QPointF(m_editToolbar->boundingRect().width() + 30, -30)); m_editToolbar->setFlag(QGraphicsItem::ItemIsMovable, false); m_editToolbar->setVisible(false); + m_editToolbar->setBackgroundBrush(palette().background()); connect(m_resetZoomPushButton, SIGNAL(clicked()), SLOT(handleResetZoomClicked())); } |