[fix] Some UI fixes

Former-commit-id: 30d64394e6
This commit is contained in:
Leroy.H.Y 2019-11-18 18:43:49 +08:00
parent dfd7f87850
commit 4361de7b31
5 changed files with 51 additions and 36 deletions

View File

@ -1 +1 @@
682
695

View File

@ -54,9 +54,7 @@
obj->setPalette(_temp);
#define BLACK(obj) \
auto _temp = obj->palette(); \
_temp.setColor(QPalette::Text, QV2RAY_IS_DARKTHEME ? Qt::white : Qt::black); \
obj->setPalette(_temp);
obj->setPalette(this->palette());
#define QV2RAY_UI_RESOURCES_ROOT QSTRING(QV2RAY_IS_DARKTHEME ? ":/icons/ui_dark/" : ":/icons/ui_light/")
#define QICON_R(file) QIcon(QV2RAY_UI_RESOURCES_ROOT + file)
@ -73,7 +71,6 @@ namespace Qv2ray
// Extra header for QvConfigUpgrade.cpp
QJsonObject UpgradeConfig(int fromVersion, int toVersion, QJsonObject root);
struct QvBarLine {
std::string Family;
bool Bold;

View File

@ -263,6 +263,7 @@ int main(int argc, char *argv[])
QPalette darkPalette;
QColor darkColor = QColor(45, 45, 45);
QColor disabledColor = QColor(127, 127, 127);
// See Qv2rayBase.hpp MACRO --> BLACK(obj)
QColor defaultTextColor = QColor(210, 210, 210);
darkPalette.setColor(QPalette::Window, darkColor);
darkPalette.setColor(QPalette::WindowText, defaultTextColor);

View File

@ -69,6 +69,6 @@ void JsonEditor::on_formatJsonBtn_clicked()
jsonEditor->setPlainText(JsonToString(JsonFromString(string)));
} else {
RED(jsonEditor)
QvMessageBox(this, tr("Json Contains Syntax Errors"), tr("Please fix it and retry later."));
QvMessageBox(this, tr("Syntax Errors"), tr("Please fix the JSON errors before continue"));
}
}

View File

@ -63,28 +63,14 @@
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="darkThemeLabel">
<property name="text">
<string>Dark Theme Support</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="darkThemeCB">
<property name="text">
<string>Enabled</string>
</property>
</widget>
</item>
<item row="3" column="0">
<item row="4" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Language</string>
</property>
</widget>
</item>
<item row="3" column="1">
<item row="4" column="1">
<widget class="QComboBox" name="languageComboBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@ -237,25 +223,56 @@
</layout>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_36">
<widget class="QLabel" name="label_55">
<property name="text">
<string>Dark Tray Icon</string>
<string>Theme Settings</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="darkTrayCB">
<property name="text">
<string>Enabled</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QCheckBox" name="checkBox_3">
<property name="text">
<string>CheckBox</string>
</property>
</widget>
<layout class="QGridLayout" name="gridLayout_6" columnstretch="1,1,3">
<item row="1" column="1">
<widget class="QCheckBox" name="darkTrayCB">
<property name="text">
<string>Enabled</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="darkThemeLabel">
<property name="text">
<string>Use Dark UI Icons</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_36">
<property name="text">
<string>Dark Tray Icon</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="darkThemeCB">
<property name="text">
<string>Enabled</string>
</property>
</widget>
</item>
<item row="0" column="2" rowspan="2">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>