diff --git a/bin/themes/linux/main.css b/bin/themes/linux/main.css index 96860266..01a1202d 100644 --- a/bin/themes/linux/main.css +++ b/bin/themes/linux/main.css @@ -1,351 +1,352 @@ /************************************* * Default Theme v0.4 * * Author: nowrep * * Based on: Firefox Chromifox Theme * * Last updated: 04.11.2011 * *************************************/ *[html-link-look="true"] { color: palette(link); text-decoration: underline; } /*MainWindow*/ #statusbar-ip-label { padding-right: 5px; } /*NavigationBar*/ #navigation-button-back { qproperty-themeIcon: "go-previous"; qproperty-fallbackIcon: url(images/go-previous.png); qproperty-iconSize: 24px 24px; } #navigation-button-back::menu-indicator { background: url(images/transp.png); } #navigation-button-next { qproperty-themeIcon: "go-next"; qproperty-fallbackIcon: url(images/go-next.png); qproperty-iconSize: 24px 24px; } #navigation-button-next::menu-indicator { background: url(images/transp.png); } #navigation-button-stop { qproperty-themeIcon: "process-stop"; qproperty-fallbackIcon: url(images/process-stop.png); qproperty-iconSize: 24px 24px; } #navigation-button-reload { qproperty-themeIcon: "view-refresh"; qproperty-fallbackIcon: url(images/view-refresh.png); qproperty-iconSize: 24px 24px; } #navigation-button-home { qproperty-themeIcon: "go-home"; qproperty-fallbackIcon: url(images/go-home.png); qproperty-iconSize: 24px 24px; } #navigation-button-addtab { qproperty-themeIcon: "list-add"; qproperty-fallbackIcon: url(images/list-add.png); qproperty-iconSize: 24px 24px; } #navigation-button-supermenu { qproperty-themeIcon: "preferences-desktop"; qproperty-fallbackIcon: url(images/preferences-desktop.png); qproperty-iconSize: 24px 24px; } /*TabWidget*/ #tabbar::tab { max-height: 26px; } #tabbar::scroller { width: 0px; } #tabwidget-button-opentabs { qproperty-icon: url(images/tabs-list-button.png); qproperty-fixedsize: 20px 25px; } #tabwidget-button-addtab { qproperty-themeIcon: "list-add"; qproperty-fallbackIcon: url(images/list-add.png); qproperty-fixedsize: 22px 25px; } #tabwidget-button-opentabs::menu-indicator { background: url(images/transp.png); } /*IconProvider*/ IconProvider { qproperty-bookmarkIcon: url(images/star-a.png); } /*LocationBar*/ #locationbar { border-width: 4px; padding-right: -4px; padding-left: -4px; padding-top: -2px; padding-bottom: -2px; qproperty-fixedheight: 27; qproperty-leftMargin: 26; } #locationbar[secured="true"] { color: black; background-color: #ffffbc; } #locationbar-bookmarkicon { margin-bottom: 2px; qproperty-pixmap: url(images/star.png); } #locationbar-bookmarkicon[bookmarked="true"] { qproperty-pixmap: url(images/star-a.png); } #locationbar-siteicon { border-image: url(images/transp.png); qproperty-fixedsize:30px 27px; padding-left: 0px; } #locationbar-rss-icon { margin-bottom:2px; qproperty-pixmap: url(images/rss.png); } #locationbar-goicon { margin-bottom:2px; qproperty-pixmap: url(images/gotoaddress.png); } #locationbar-down-icon { margin-bottom: 1px; qproperty-pixmap: url(images/navigation-dropdown.png); } /*BookmarksToolbar*/ #bookmarksbar QToolButton { border-image: url(images/transp.png); border-width: 0px; height: 15px; } #bookmarksbar QToolButton::menu-indicator { background: url(images/transp.png); } /*SideBar*/ #sidebar { background: transparent; } /*WebSearchBar*/ #websearchbar { border-width: 4px; padding-right: -4px; padding-top: -2px; padding-bottom: -2px; qproperty-fixedheight: 27; qproperty-leftMargin: 30; } #websearchbar-searchbutton { margin-bottom:2px; margin-right: 2px; qproperty-pixmap: url(images/search-icon.png); + qproperty-themeIcon: "edit-find"; } #websearchbar-searchprovider-comobobox { border-image: url(images/websearch-bg.png); padding-left:-8px; qproperty-fixedsize: 37px 27px; } #websearchbar-searchprovider-comobobox::menu-indicator { background: url(images/transp.png); } /*SourceViewer*/ #sourceviewer-textedit { border:none; } /*SourceViewerSearch*/ SourceViewerSearch #lineEdit[notfound="true"] { background:#ff6666; } /*SearchToolbar*/ SearchToolBar #lineEdit[notfound="true"] { background:#ff6666; } /*Click2Flash*/ #click2flash-frame { border: 1px solid #e8e8e8; } #click2flash-toolbutton { background: url(images/flash.png) no-repeat; background-position: center; border: none; } #click2flash-toolbutton:hover { background: url(images/flashstart.png) no-repeat; background-position: center; border:none; } /*RSSManager*/ #rssmanager-frame { background: white; } RSSManager QTabBar::tab { max-width:100px; } /*AboutDialog*/ AboutDialog #label { background:white; } AboutDialog #textBrowser { border:none; margin-top: -2px; /* Workarounding rounded border on KDE */ } /*DesktopNotification*/ DesktopNotification { background: transparent; } DesktopNotification #frame { border: 2px solid darkblue; border-radius: 20px; background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1,stop:0 #e4ecf1, stop:1 #d3e5f1); } DesktopNotification #heading { font: bold; font-size: 13pt; } /*BrowsingLibrary*/ BrowsingLibrary #tabs { qproperty-bgPixmap: url(images/library-bg-left.png); } BrowsingLibrary #frame { background: url(images/library-bg-top.png) no-repeat; } BrowsingLibrary #frame_2 { background: url(images/library-bg-top-right.png); } BrowsingLibrary #searchLine { background: transparent; border-image: url(images/library-search-bg.png); border-width:4; color:black; } /*Downloads*/ DownloadItem #fileName { font-size: 13pt; } DownloadManager #list { border: none; } /*JavaScript Dialogs*/ #jsFrame { background: url(images/semi-transp.png); } QFrame[js-frame="true"] { border: 1px solid black; border-bottom: 0px; background-color: white; } QFrame[js-frame2="true"] { border: 1px solid black; border-top: 0px; background-color: #f3f3f3; } diff --git a/src/lib/tools/clickablelabel.cpp b/src/lib/tools/clickablelabel.cpp index f5932ef5..dec07027 100644 --- a/src/lib/tools/clickablelabel.cpp +++ b/src/lib/tools/clickablelabel.cpp @@ -1,43 +1,58 @@ /* ============================================================ * QupZilla - WebKit based browser * Copyright (C) 2010-2012 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * ============================================================ */ #include "clickablelabel.h" #include +#include ClickableLabel::ClickableLabel(QWidget* parent) : QLabel(parent) { } +void ClickableLabel::setThemeIcon(const QString &name) +{ + QIcon icon(name); + + if (!icon.isNull()) { + setPixmap(icon.pixmap(size())); + } +} + +QString ClickableLabel::themeIcon() const +{ + return m_themeIcon; +} + void ClickableLabel::mouseReleaseEvent(QMouseEvent* ev) { if (ev->button() == Qt::LeftButton && rect().contains(ev->pos())) { if (ev->modifiers() == Qt::ControlModifier) { emit middleClicked(ev->globalPos()); } else { emit clicked(ev->globalPos()); } } else if (ev->button() == Qt::MiddleButton && rect().contains(ev->pos())) { emit middleClicked(ev->globalPos()); } else { QLabel::mouseReleaseEvent(ev); } } diff --git a/src/lib/tools/clickablelabel.h b/src/lib/tools/clickablelabel.h index b363e110..632add98 100644 --- a/src/lib/tools/clickablelabel.h +++ b/src/lib/tools/clickablelabel.h @@ -1,46 +1,52 @@ /* ============================================================ * QupZilla - WebKit based browser * Copyright (C) 2010-2012 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * ============================================================ */ #ifndef CLICKABLELABEL_H #define CLICKABLELABEL_H #include #include "qz_namespace.h" class QMouseEvent; class QT_QUPZILLA_EXPORT ClickableLabel : public QLabel { Q_OBJECT Q_PROPERTY(QSize fixedsize READ size WRITE setFixedSize) Q_PROPERTY(int fixedwidth READ width WRITE setFixedWidth) Q_PROPERTY(int fixedheight READ height WRITE setFixedHeight) + Q_PROPERTY(QString themeIcon READ themeIcon WRITE setThemeIcon) public: explicit ClickableLabel(QWidget* parent = 0); + void setThemeIcon(const QString &name); + QString themeIcon() const; + signals: void clicked(QPoint); void middleClicked(QPoint); private: void mouseReleaseEvent(QMouseEvent* ev); + QString m_themeIcon; + }; #endif // CLICKABLELABEL_H