Skip to content

Commit 726970a

Browse files
Fix several interface bugs and dehardcode
1 parent a149f66 commit 726970a

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

src/GUI/GUIConfig.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class GUIConfig
1212
inline static const int ICON_MIN_HEIGHT = 80;
1313
inline static const int ICON_SCALING_HEIGHT = 25;
1414
inline static const QString ICONS_FOLDER = Config::RESOURCE_FOLDER + "/Icons";
15-
inline static const QString STYLES_SHEET = "Resources/Styles.css";
15+
inline static const QString STYLES_SHEET = Config::RESOURCE_FOLDER + "/Styles.css";
1616
inline static const QString QT_ICONS_FOLDER = ":/icons";
1717
inline static const QString MISSING_ICON_PATH = QT_ICONS_FOLDER + "/NoImageSmall.webp";
1818
inline static const QString EDITOR_ICON_PATH = QT_ICONS_FOLDER + "/EditorIconSmall.webp";

src/GUI/GreetingWidget.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ GreetingWidget::GreetingWidget(Config::Languages language, QWidget* parent) : QW
1919
QHBoxLayout* ltLanguages = nullptr;
2020
QVBoxLayout* ltMain = nullptr;
2121

22-
// Makes greeting window unresizeable
22+
// Makes greeting window unresizeable and equal to the size of the background file
2323
setFixedSize(795, 440);
2424

2525
// Add "New Project" and "Load Project" buttons to the window

src/GUI/WindowManager.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ WindowManager::WindowManager()
1010
WindowName = "C&C: Generals Zero Hour Hotkey Editor";
1111

1212
qApp->setWindowIcon(QIcon(QPixmap::fromImage(GUIConfig::DecodeEditorWebpIcon())));
13+
// qApp->setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
1314

1415
LOGMSG(QString("Loading loading \"") + GUIConfig::STYLES_SHEET + "\"...");
1516
QFile css{GUIConfig::STYLES_SHEET};

src/Styles.css

+11-4
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ QComboBox::down-arrow, QSpinBox::down-arrow, QTimeEdit::down-arrow, QDateEdit::d
5151
}
5252

5353
/* Start widget style setting */
54-
55-
LoadDialog, LaunchWidget, CreationDialog, HotkeysMainWindow
54+
LoadDialog, LaunchWidget, CreationDialog
5655
{
57-
background-image: url(Resources/Icons/StartMenuBackground.png);
56+
/* background: center no-repeat url(Resources/Icons/StartMenuBackground.png); */
57+
/* Watch at https://forum.qt.io/topic/40151/solved-scaled-background-image-using-stylesheet/3 */
58+
border-image: url(Resources/Icons/StartMenuBackground.png) 0 0 0 0 stretch stretch;
5859
background-color: black;
59-
/* background-position: center; */
6060
}
6161

6262
BaseConfigurationDialog QPushButton
@@ -101,6 +101,13 @@ QPushButton#btnReview
101101

102102
/* ------------------------------------------------------------------------------ */
103103

104+
HotkeysMainWindow
105+
{
106+
/* Watch at https://forum.qt.io/topic/40151/solved-scaled-background-image-using-stylesheet/3 */
107+
border-image: url(Resources/Icons/StartMenuBackground.png) 0 0 0 0 stretch stretch;
108+
background-color: black;
109+
}
110+
104111
HotkeysMainWindow, HotkeysMainWindow#QVBoxLayout, HotkeysMainWindow#QHBoxLayout, HotkeysMainWindow#QBoxLayout, HotkeysMainWindow#QWidget,
105112
ActionHotkeyWidget, ActionHotkeyWidget#QVBoxLayout, ActionHotkeyWidget#QHBoxLayout, ActionHotkeyWidget#QBoxLayout, ActionHotkeyWidget#QWidget
106113
{

0 commit comments

Comments
 (0)