Adjust more buttons and logo in AboutDialog to dark theme

This commit is contained in:
Florian Märkl 2017-12-03 21:01:11 +01:00
parent 2417963329
commit 2a7d2b79b6
6 changed files with 85 additions and 145 deletions

View File

@ -9,6 +9,10 @@ AboutDialog::AboutDialog(QWidget *parent) :
{ {
ui->setupUi(this); ui->setupUi(this);
setWindowFlags(windowFlags() & (~Qt::WindowContextHelpButtonHint)); setWindowFlags(windowFlags() & (~Qt::WindowContextHelpButtonHint));
QString logoFile = (palette().window().color().value() < 127) ? ":/img/cutter_white.svg" : ":/img/cutter.svg";
ui->logoSvgWidget->load(logoFile);
ui->label->setText(tr("<h1>Cutter</h1>" ui->label->setText(tr("<h1>Cutter</h1>"
"Version " CUTTER_VERSION "<br/>" "Version " CUTTER_VERSION "<br/>"
"Using r2-" R2_GITTAP "Using r2-" R2_GITTAP

View File

@ -13,87 +13,44 @@
<property name="windowTitle"> <property name="windowTitle">
<string>About Cutter</string> <string>About Cutter</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing">
<number>5</number>
</property>
<property name="leftMargin">
<number>5</number>
</property>
<property name="topMargin">
<number>5</number>
</property>
<property name="rightMargin">
<number>5</number>
</property>
<property name="bottomMargin">
<number>5</number>
</property>
<item> <item>
<layout class="QVBoxLayout" name="verticalLayout_2"> <widget class="QSvgWidget" name="logoSvgWidget" native="true">
<property name="spacing"> <property name="minimumSize">
<number>0</number> <size>
<width>96</width>
<height>96</height>
</size>
</property> </property>
<item> <property name="maximumSize">
<widget class="QLabel" name="aboutLogo"> <size>
<property name="sizePolicy"> <width>96</width>
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <height>96</height>
<horstretch>0</horstretch> </size>
<verstretch>0</verstretch> </property>
</sizepolicy> </widget>
</property> </item>
<property name="minimumSize"> <item>
<size> <widget class="QLabel" name="label">
<width>96</width> <property name="sizePolicy">
<height>96</height> <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
</size> <horstretch>0</horstretch>
</property> <verstretch>0</verstretch>
<property name="maximumSize"> </sizepolicy>
<size> </property>
<width>96</width> <property name="styleSheet">
<height>96</height> <string notr="true">s</string>
</size> </property>
</property> <property name="text">
<property name="text"> <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string notr="true"/> </property>
</property> <property name="alignment">
<property name="pixmap"> <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
<pixmap resource="../resources.qrc">:/img/cutter.svg</pixmap> </property>
</property> <property name="margin">
<property name="scaledContents"> <number>5</number>
<bool>true</bool> </property>
</property> </widget>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="margin">
<number>8</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true">s</string>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="margin">
<number>5</number>
</property>
</widget>
</item>
</layout>
</item> </item>
<item> <item>
<widget class="QDialogButtonBox" name="buttonBox"> <widget class="QDialogButtonBox" name="buttonBox">
@ -104,6 +61,14 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets>
<customwidget>
<class>QSvgWidget</class>
<extends>QWidget</extends>
<header>QSvgWidget</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources> <resources>
<include location="../resources.qrc"/> <include location="../resources.qrc"/>
</resources> </resources>

View File

@ -6,6 +6,7 @@
#include "MainWindow.h" #include "MainWindow.h"
#include "utils/Helpers.h" #include "utils/Helpers.h"
#include "utils/TempConfig.h" #include "utils/TempConfig.h"
#include "utils/SvgIconEngine.h"
#include <QTemporaryFile> #include <QTemporaryFile>
#include <QFontDialog> #include <QFontDialog>
@ -35,6 +36,9 @@ HexdumpWidget::HexdumpWidget(QWidget *parent, Qt::WindowFlags flags) :
//connect(ui->hexHexText, SIGNAL(cursorPositionChanged()), this, SLOT(highlightHexCurrentLine())); //connect(ui->hexHexText, SIGNAL(cursorPositionChanged()), this, SLOT(highlightHexCurrentLine()));
//highlightHexCurrentLine(); //highlightHexCurrentLine();
ui->copyMD5->setIcon(QIcon(new SvgIconEngine(QString(":/img/icons/transfer.svg"), palette().buttonText().color())));
ui->copySHA1->setIcon(QIcon(new SvgIconEngine(QString(":/img/icons/transfer.svg"), palette().buttonText().color())));
int margin = static_cast<int>(ui->hexOffsetText->document()->documentMargin()); int margin = static_cast<int>(ui->hexOffsetText->document()->documentMargin());
ui->offsetHeaderLabel->setContentsMargins(margin, 0, margin, 0); ui->offsetHeaderLabel->setContentsMargins(margin, 0, margin, 0);

View File

@ -322,7 +322,7 @@ QToolTip {
<enum>QTabWidget::North</enum> <enum>QTabWidget::North</enum>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>1</number>
</property> </property>
<property name="usesScrollButtons"> <property name="usesScrollButtons">
<bool>true</bool> <bool>true</bool>
@ -687,37 +687,15 @@ QToolTip {
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">QToolButton { /* all types of tool button */ <string notr="true">QToolButton { /* all types of tool button */
border: 0px solid rgb(255, 255, 255); padding: 1px;
padding-left: 5px;
padding-right: 5px;
background-color: palette(button);
border-radius: 6px; border-radius: 6px;
border-left: 5px solid rgb(255, 255, 255);
border-right: 5px solid rgb(255, 255, 255);
margin-bottom: 1px;
margin-top: 1px;
background-color: rgb(255, 255, 255);
image: url(:/img/icons/transfer.svg);
}
QToolButton:hover {
border: 0px solid #2180a9;
border-radius: 6px;
border-left: 5px solid #2180a9;
border-right: 5px solid #2180a9;
margin-bottom: 1px;
margin-top: 1px;
background-color: #2180a9;
image: url(:/img/icons/transfer_white.svg);
} }
QToolButton:pressed { QToolButton:pressed {
border: 0px solid rgb(255, 255, 255); background-color: palette(dark);
border-radius: 6px;
border-left: 5px solid rgb(255, 255, 255);
border-right: 5px solid rgb(255, 255, 255);
margin-bottom: 1px;
margin-top: 1px;
background-color: rgb(255, 255, 255);
image: url(:/img/icons/transfer.svg);
} }
QToolTip { QToolTip {
@ -768,37 +746,15 @@ QToolTip {
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">QToolButton { /* all types of tool button */ <string notr="true">QToolButton { /* all types of tool button */
border: 0px solid rgb(255, 255, 255); padding: 1px;
padding-left: 5px;
padding-right: 5px;
background-color: palette(button);
border-radius: 6px; border-radius: 6px;
border-left: 5px solid rgb(255, 255, 255);
border-right: 5px solid rgb(255, 255, 255);
margin-bottom: 1px;
margin-top: 1px;
background-color: rgb(255, 255, 255);
image: url(:/img/icons/transfer.svg);
}
QToolButton:hover {
border: 0px solid #2180a9;
border-radius: 6px;
border-left: 5px solid #2180a9;
border-right: 5px solid #2180a9;
margin-bottom: 1px;
margin-top: 1px;
background-color: #2180a9;
image: url(:/img/icons/transfer_white.svg);
} }
QToolButton:pressed { QToolButton:pressed {
border: 0px solid rgb(255, 255, 255); background-color: palette(dark);
border-radius: 6px;
border-left: 5px solid rgb(255, 255, 255);
border-right: 5px solid rgb(255, 255, 255);
margin-bottom: 1px;
margin-top: 1px;
background-color: rgb(255, 255, 255);
image: url(:/img/icons/transfer.svg);
} }
QToolTip { QToolTip {

View File

@ -5,6 +5,7 @@
#include "utils/MdHighlighter.h" #include "utils/MdHighlighter.h"
#include "utils/Highlighter.h" #include "utils/Highlighter.h"
#include "utils/SvgIconEngine.h"
#include <QPlainTextEdit> #include <QPlainTextEdit>
#include <QFont> #include <QFont>
@ -20,6 +21,9 @@ Notepad::Notepad(MainWindow *main, QWidget *parent) :
{ {
ui->setupUi(this); ui->setupUi(this);
ui->undoButton->setIcon(QIcon(new SvgIconEngine(QString(":/img/icons/undo.svg"), palette().buttonText().color())));
ui->redoButton->setIcon(QIcon(new SvgIconEngine(QString(":/img/icons/redo.svg"), palette().buttonText().color())));
// Radare core found in: // Radare core found in:
this->main = main; this->main = main;

View File

@ -190,11 +190,16 @@ color: rgb(48, 48, 48);
<item> <item>
<widget class="QToolButton" name="undoButton"> <widget class="QToolButton" name="undoButton">
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">border-radius: 5px; <string notr="true">
border: none; QToolButton { /* all types of tool button */
padding: 2px; padding: 2px;
/*color: darkgray;*/ background-color: palette(light);
background-color: rgb(232, 232, 232);</string> border-radius: 5px;
}
QToolButton:pressed {
background-color: palette(dark);
}</string>
</property> </property>
<property name="text"> <property name="text">
<string>...</string> <string>...</string>
@ -208,13 +213,15 @@ background-color: rgb(232, 232, 232);</string>
<item> <item>
<widget class="QToolButton" name="redoButton"> <widget class="QToolButton" name="redoButton">
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">border-radius: 5px; <string notr="true">QToolButton { /* all types of tool button */
border: none; padding: 2px;
padding: 2px; background-color: palette(light);
/*color: darkgray;*/ border-radius: 5px;
background-color: rgb(232, 232, 232); }
</string> QToolButton:pressed {
background-color: palette(dark);
}</string>
</property> </property>
<property name="text"> <property name="text">
<string>...</string> <string>...</string>