0
0
mirror of https://github.com/yse/easy_profiler.git synced 2024-12-26 08:01:51 +08:00

#0 [GUI] Styling

This commit is contained in:
Victor Zarubkin 2017-11-17 21:22:53 +03:00
parent aa1ddb44ca
commit 86ed82aea4
12 changed files with 145 additions and 36 deletions

View File

@ -27,18 +27,16 @@ QLineEdit, QPushButton {
background-color: white;
}
QPushButton {
padding: 2px 5px 2px 5px;
}
QLineEdit:focus { border: 1px ridge #f44336; }
QPushButton:hover {
border: 1px solid #f4a386;
color: #806070;
}
QPushButton { padding: 2px 5px 2px 5px; }
QPushButton:hover { border: 1px solid #f4a386; color: #806070; }
QPushButton:pressed { border: 1px solid #d47366; color: #705060; }
QPushButton:pressed {
border: 1px solid #d47366;
color: #705060;
QComboBox QListView {
background-color: white;
border: 1px solid #cccccc;
selection-background-color: rgba(96, 112, 208, 64);
}
/* ****************************************************************************************************************** */
@ -152,16 +150,16 @@ QHeaderView::section {
/* ****************************************************************************************************************** */
QDockWidget QWidget#EasyDockWidgetTitle {
EasyDockWidget QWidget#EasyDockWidgetTitle {
background-color: #666666;
}
QDockWidget QWidget#EasyDockWidgetTitle QLabel {
EasyDockWidget QWidget#EasyDockWidgetTitle QLabel {
color: white;
margin-left: 4px;
}
QDockWidget QWidget#EasyDockWidgetTitle QPushButton {
EasyDockWidget QWidget#EasyDockWidgetTitle QPushButton {
background: none;
border: none;
max-height: 12px;
@ -170,10 +168,17 @@ QDockWidget QWidget#EasyDockWidgetTitle QPushButton {
padding: 0;
}
QDockWidget QWidget#EasyDockWidgetTitle QPushButton#EasyDockWidgetFloatButton { image: url(":/DockMaximizeWhite"); }
QDockWidget QWidget#EasyDockWidgetTitle QPushButton#EasyDockWidgetFloatButton:hover { image: url(":/DockMaximizeWhiteHover"); }
QDockWidget QWidget#EasyDockWidgetTitle QPushButton#EasyDockWidgetCloseButton { image: url(":/DockCloseWhite"); }
QDockWidget QWidget#EasyDockWidgetTitle QPushButton#EasyDockWidgetCloseButton:hover { image: url(":/DockCloseWhiteHover"); }
EasyDockWidget QWidget#EasyDockWidgetTitle QPushButton#EasyDockWidgetFloatButton { image: url(":/DockMaximizeWhite"); }
EasyDockWidget QWidget#EasyDockWidgetTitle QPushButton#EasyDockWidgetFloatButton:hover { image: url(":/DockMaximizeWhiteHover"); }
EasyDockWidget QWidget#EasyDockWidgetTitle QPushButton#EasyDockWidgetFloatButton:pressed { image: url(":/DockMaximizeWhitePressed"); }
EasyDockWidget QWidget#EasyDockWidgetTitle QPushButton#EasyDockWidgetFloatButton[floating=true] { image: url(":/DockMinimizeWhite"); }
EasyDockWidget QWidget#EasyDockWidgetTitle QPushButton#EasyDockWidgetFloatButton[floating=true]:hover { image: url(":/DockMinimizeWhiteHover"); }
EasyDockWidget QWidget#EasyDockWidgetTitle QPushButton#EasyDockWidgetFloatButton[floating=true]:pressed { image: url(":/DockMinimizeWhitePressed"); }
EasyDockWidget QWidget#EasyDockWidgetTitle QPushButton#EasyDockWidgetCloseButton { image: url(":/DockCloseWhite"); }
EasyDockWidget QWidget#EasyDockWidgetTitle QPushButton#EasyDockWidgetCloseButton:hover { image: url(":/DockCloseWhiteHover"); }
EasyDockWidget QWidget#EasyDockWidgetTitle QPushButton#EasyDockWidgetCloseButton:pressed { image: url(":/DockCloseWhitePressed"); }

View File

@ -24,8 +24,12 @@ search-next.svg - Icon made by Freepik from www.flaticon.com
settings.svg - Icon made by Freepik from www.flaticon.com
check.svg - Icon made by Kirill Kazachek from www.flaticon.com
check-disabled.svg - Icon made by Kirill Kazachek from www.flaticon.com
close-white.svg - Icon made by Cole Bemis from www.flaticon.com
close-white-disabled.svg - Icon made by Cole Bemis from www.flaticon.com
maximize-white.svg - Icon made by Google from www.flaticon.com
maximize-white-disabled.svg - Icon made by Google from www.flaticon.com
close-white.svg - Icon made by Cole Bemis from www.flaticon.com
close-white-hover.svg - Icon made by Cole Bemis from www.flaticon.com
close-white-pressed.svg - Icon made by Cole Bemis from www.flaticon.com
maximize-white.svg - Icon made by Freepik from www.flaticon.com
maximize-white-hover.svg - Icon made by Freepik from www.flaticon.com
maximize-white-pressed.svg - Icon made by Freepik from www.flaticon.com
minimize-white.svg - Icon made by Freepik from www.flaticon.com
minimize-white-pressed.svg - Icon made by Freepik from www.flaticon.com

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve">
<g>
<path fill="#f44336" d="M505.943,6.058c-8.077-8.077-21.172-8.077-29.249,0L6.058,476.693c-8.077,8.077-8.077,21.172,0,29.249
C10.096,509.982,15.39,512,20.683,512c5.293,0,10.586-2.019,14.625-6.059L505.943,35.306
C514.019,27.23,514.019,14.135,505.943,6.058z"/>
<path fill="#f44336" d="M505.942,476.694L35.306,6.059c-8.076-8.077-21.172-8.077-29.248,0c-8.077,8.076-8.077,21.171,0,29.248l470.636,470.636
c4.038,4.039,9.332,6.058,14.625,6.058c5.293,0,10.587-2.019,14.624-6.057C514.018,497.866,514.018,484.771,505.942,476.694z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 899 B

View File

@ -1,10 +1,16 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 384 384" style="enable-background:new 0 0 384 384;" xml:space="preserve">
width="483.252px" height="483.252px" viewBox="0 0 483.252 483.252" style="enable-background:new 0 0 483.252 483.252;"
xml:space="preserve">
<g>
<path fill="#e0e0e0" d="M341.333,341.333H42.667V42.667H192V0H42.667C19.093,0,0,19.093,0,42.667v298.667C0,364.907,19.093,384,42.667,384
h298.667C364.907,384,384,364.907,384,341.333V192h-42.667V341.333z"/>
<polygon fill="#e0e0e0" points="234.667,0 234.667,42.667 311.147,42.667 101.44,252.373 131.627,282.56 341.333,72.853 341.333,149.333
384,149.333 384,0"/>
<path fill="#e0e0e0" d="M481.354,263.904v166.979c0,28.88-23.507,52.369-52.387,52.369H53.646c-28.889,0-52.393-23.489-52.393-52.369V55.969
c0-28.877,23.504-52.372,52.393-52.372h167.428c-9.014,9.247-15.004,21.45-16.319,35.007H53.64c-9.582,0-17.377,7.79-17.377,17.365
v374.914c0,9.575,7.796,17.366,17.377,17.366h375.322c9.581,0,17.378-7.791,17.378-17.366V280.199
C459.515,278.935,471.744,273.267,481.354,263.904z M277.895,52.52h114.456L207.086,237.79c-10.255,10.249-10.255,26.882,0,37.132
c10.252,10.255,26.879,10.255,37.131,0.006L429.482,89.657v114.462c0,14.502,11.756,26.256,26.261,26.256
c7.247,0,13.813-2.929,18.566-7.687c4.752-4.764,7.689-11.319,7.689-18.569V26.256C481.999,11.754,470.249,0,455.743,0H277.895
c-14.499,0-26.256,11.754-26.256,26.262C251.633,40.764,263.396,52.52,277.895,52.52z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 639 B

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="483.252px" height="483.252px" viewBox="0 0 483.252 483.252" style="enable-background:new 0 0 483.252 483.252;"
xml:space="preserve">
<g>
<path fill="#e0cccc" d="M481.354,263.904v166.979c0,28.88-23.507,52.369-52.387,52.369H53.646c-28.889,0-52.393-23.489-52.393-52.369V55.969
c0-28.877,23.504-52.372,52.393-52.372h167.428c-9.014,9.247-15.004,21.45-16.319,35.007H53.64c-9.582,0-17.377,7.79-17.377,17.365
v374.914c0,9.575,7.796,17.366,17.377,17.366h375.322c9.581,0,17.378-7.791,17.378-17.366V280.199
C459.515,278.935,471.744,273.267,481.354,263.904z M277.895,52.52h114.456L207.086,237.79c-10.255,10.249-10.255,26.882,0,37.132
c10.252,10.255,26.879,10.255,37.131,0.006L429.482,89.657v114.462c0,14.502,11.756,26.256,26.261,26.256
c7.247,0,13.813-2.929,18.566-7.687c4.752-4.764,7.689-11.319,7.689-18.569V26.256C481.999,11.754,470.249,0,455.743,0H277.895
c-14.499,0-26.256,11.754-26.256,26.262C251.633,40.764,263.396,52.52,277.895,52.52z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -1,10 +1,16 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 384 384" style="enable-background:new 0 0 384 384;" xml:space="preserve">
width="483.252px" height="483.252px" viewBox="0 0 483.252 483.252" style="enable-background:new 0 0 483.252 483.252;"
xml:space="preserve">
<g>
<path fill="#ffffff" d="M341.333,341.333H42.667V42.667H192V0H42.667C19.093,0,0,19.093,0,42.667v298.667C0,364.907,19.093,384,42.667,384
h298.667C364.907,384,384,364.907,384,341.333V192h-42.667V341.333z"/>
<polygon fill="#ffffff" points="234.667,0 234.667,42.667 311.147,42.667 101.44,252.373 131.627,282.56 341.333,72.853 341.333,149.333
384,149.333 384,0"/>
<path fill="#ffffff" d="M481.354,263.904v166.979c0,28.88-23.507,52.369-52.387,52.369H53.646c-28.889,0-52.393-23.489-52.393-52.369V55.969
c0-28.877,23.504-52.372,52.393-52.372h167.428c-9.014,9.247-15.004,21.45-16.319,35.007H53.64c-9.582,0-17.377,7.79-17.377,17.365
v374.914c0,9.575,7.796,17.366,17.377,17.366h375.322c9.581,0,17.378-7.791,17.378-17.366V280.199
C459.515,278.935,471.744,273.267,481.354,263.904z M277.895,52.52h114.456L207.086,237.79c-10.255,10.249-10.255,26.882,0,37.132
c10.252,10.255,26.879,10.255,37.131,0.006L429.482,89.657v114.462c0,14.502,11.756,26.256,26.261,26.256
c7.247,0,13.813-2.929,18.566-7.687c4.752-4.764,7.689-11.319,7.689-18.569V26.256C481.999,11.754,470.249,0,455.743,0H277.895
c-14.499,0-26.256,11.754-26.256,26.262C251.633,40.764,263.396,52.52,277.895,52.52z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 639 B

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="480.221px" height="480.221px" viewBox="0 0 480.221 480.221" style="enable-background:new 0 0 480.221 480.221;"
xml:space="preserve">
<g>
<path fill="#e0e0e0" d="M480.158,260.878v166.979c0,28.874-23.501,52.363-52.381,52.363H52.453c-28.889,0-52.39-23.489-52.39-52.363V52.938
c0-28.874,23.501-52.369,52.39-52.369h167.434c-9.011,9.244-15.004,21.45-16.316,35.003H52.447
c-9.582,0-17.378,7.791-17.378,17.366v374.92c0,9.569,7.796,17.36,17.378,17.36h375.325c9.581,0,17.372-7.791,17.372-17.36V277.169
C458.33,275.904,470.56,270.236,480.158,260.878z M399.287,230.096H284.831L470.099,44.829c10.249-10.261,10.249-26.882,0-37.131
c-10.256-10.261-26.883-10.261-37.132-0.012L247.7,192.958V78.497c0-14.499-11.757-26.262-26.259-26.262
c-7.25,0-13.816,2.932-18.569,7.689c-4.752,4.765-7.693,11.325-7.693,18.572v177.854c0,14.499,11.754,26.256,26.256,26.256h177.852
c14.505,0,26.256-11.751,26.256-26.256S413.792,230.096,399.287,230.096z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="480.221px" height="480.221px" viewBox="0 0 480.221 480.221" style="enable-background:new 0 0 480.221 480.221;"
xml:space="preserve">
<g>
<path fill="#e0cccc" d="M480.158,260.878v166.979c0,28.874-23.501,52.363-52.381,52.363H52.453c-28.889,0-52.39-23.489-52.39-52.363V52.938
c0-28.874,23.501-52.369,52.39-52.369h167.434c-9.011,9.244-15.004,21.45-16.316,35.003H52.447
c-9.582,0-17.378,7.791-17.378,17.366v374.92c0,9.569,7.796,17.36,17.378,17.36h375.325c9.581,0,17.372-7.791,17.372-17.36V277.169
C458.33,275.904,470.56,270.236,480.158,260.878z M399.287,230.096H284.831L470.099,44.829c10.249-10.261,10.249-26.882,0-37.131
c-10.256-10.261-26.883-10.261-37.132-0.012L247.7,192.958V78.497c0-14.499-11.757-26.262-26.259-26.262
c-7.25,0-13.816,2.932-18.569,7.689c-4.752,4.765-7.693,11.325-7.693,18.572v177.854c0,14.499,11.754,26.256,26.256,26.256h177.852
c14.505,0,26.256-11.751,26.256-26.256S413.792,230.096,399.287,230.096z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="480.221px" height="480.221px" viewBox="0 0 480.221 480.221" style="enable-background:new 0 0 480.221 480.221;"
xml:space="preserve">
<g>
<path fill="#ffffff" d="M480.158,260.878v166.979c0,28.874-23.501,52.363-52.381,52.363H52.453c-28.889,0-52.39-23.489-52.39-52.363V52.938
c0-28.874,23.501-52.369,52.39-52.369h167.434c-9.011,9.244-15.004,21.45-16.316,35.003H52.447
c-9.582,0-17.378,7.791-17.378,17.366v374.92c0,9.569,7.796,17.36,17.378,17.36h375.325c9.581,0,17.372-7.791,17.372-17.36V277.169
C458.33,275.904,470.56,270.236,480.158,260.878z M399.287,230.096H284.831L470.099,44.829c10.249-10.261,10.249-26.882,0-37.131
c-10.256-10.261-26.883-10.261-37.132-0.012L247.7,192.958V78.497c0-14.499-11.757-26.262-26.259-26.262
c-7.25,0-13.816,2.932-18.569,7.689c-4.752,4.765-7.693,11.325-7.693,18.572v177.854c0,14.499,11.754,26.256,26.256,26.256h177.852
c14.505,0,26.256-11.751,26.256-26.256S413.792,230.096,399.287,230.096z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -138,8 +138,13 @@ EasyDockWidget::EasyDockWidget(const QString& title, QWidget* parent) : QDockWid
{
auto floatingButton = new QPushButton();
floatingButton->setObjectName("EasyDockWidgetFloatButton");
connect(floatingButton, &QPushButton::clicked, [this] {
floatingButton->setProperty("floating", isFloating());
connect(floatingButton, &QPushButton::clicked, [this, floatingButton] {
setFloating(!isFloating());
floatingButton->setProperty("floating", isFloating());
floatingButton->style()->unpolish(floatingButton);
floatingButton->style()->polish(floatingButton);
floatingButton->update();
});
auto closeButton = new QPushButton();

View File

@ -194,10 +194,12 @@ private:
//////////////////////////////////////////////////////////////////////////
struct EasyDockWidget : public QDockWidget
class EasyDockWidget : public QDockWidget
{
EasyDockWidget(const QString& title, QWidget* parent = nullptr);
virtual ~EasyDockWidget();
Q_OBJECT
public:
explicit EasyDockWidget(const QString& title, QWidget* parent = nullptr);
~EasyDockWidget() override;
};
class EasyMainWindow : public QMainWindow
@ -252,7 +254,7 @@ protected:
public:
explicit EasyMainWindow();
virtual ~EasyMainWindow();
~EasyMainWindow() override;
// Public virtual methods

View File

@ -32,7 +32,12 @@
<file alias="RadioIndicatorDisabled">icons/radio-indicator-disabled.svg</file>
<file alias="DockMaximizeWhite">icons/maximize-white.svg</file>
<file alias="DockMaximizeWhiteHover">icons/maximize-white-hover.svg</file>
<file alias="DockMaximizeWhitePressed">icons/maximize-white-pressed.svg</file>
<file alias="DockMinimizeWhite">icons/minimize-white.svg</file>
<file alias="DockMinimizeWhiteHover">icons/minimize-white-hover.svg</file>
<file alias="DockMinimizeWhitePressed">icons/minimize-white-pressed.svg</file>
<file alias="DockCloseWhite">icons/close-white.svg</file>
<file alias="DockCloseWhiteHover">icons/close-white-hover.svg</file>
<file alias="DockCloseWhitePressed">icons/close-white-pressed.svg</file>
</qresource>
</RCC>