Skip to content

Commit

Permalink
Experimenting with sizes and comboboxes
Browse files Browse the repository at this point in the history
  • Loading branch information
MahBoiDeveloper committed Apr 20, 2024
1 parent 3a7e196 commit f4fc397
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 14 deletions.
7 changes: 5 additions & 2 deletions src/GUI/GreetingWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ GreetingWidget::GreetingWidget(Config::Languages language, QWidget* parent) : QW
QVBoxLayout* ltMain = nullptr;

// Makes greeting window unresizeable
setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
// setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
// setFixedSize(800, 600);

// Add "New Project" and "Load Project" buttons to the window
btnNewProject = new QPushButton(tr("New Project"));
Expand Down Expand Up @@ -69,7 +70,6 @@ GreetingWidget::GreetingWidget(Config::Languages language, QWidget* parent) : QW
"We hope that you will like the program."));
lblGreeting->setWordWrap(true);
lblGreeting->setAlignment(Qt::AlignVCenter);
lblGreeting->setFixedWidth(GetGreetingTextAverageSize(lblGreeting->text()) + 50);

ltContent = new QHBoxLayout();
ltContent->setAlignment(Qt::AlignLeft);
Expand All @@ -83,6 +83,9 @@ GreetingWidget::GreetingWidget(Config::Languages language, QWidget* parent) : QW
ltMain->addLayout(ltContent);

setLayout(ltMain);

// LOGMSG(QString("Width = ") + QString::number(this->width()));
// LOGMSG(QString("Height = ") + QString::number(this->height()));
}

/// @brief Calculate size of long description text block.
Expand Down
3 changes: 2 additions & 1 deletion src/GUI/LaunchWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ LaunchWidget::LaunchWidget(Config::Languages lngType, QWidget* parent) : QStacke
qApp->setWindowIcon(QIcon(QPixmap::fromImage(GUIConfig::DecodeEditorWebpIcon())));

// MainLaunchWidget settings
setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
// setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
setFixedSize(795, 440);
setWindowFlags(windowFlags() | Qt::MSWindowsFixedSizeDialogHint);
setWindowFlags(windowFlags() & ~Qt::WindowMaximizeButtonHint &
~Qt::WindowMinimizeButtonHint);
Expand Down
41 changes: 34 additions & 7 deletions src/GUI/QtSources/mainStyleSheet.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ GreetingWidget QPushButton, LoadDialog QPushButton, CreationDialog QPushButton
padding: 10px;

color: white;
background-color: #3543e7;
background-color: #181d5a;

border-style: outset;
border-width: 2px;
Expand All @@ -20,27 +20,54 @@ GreetingWidget QPushButton, LoadDialog QPushButton, CreationDialog QPushButton

GreetingWidget QPushButton:hover, LoadDialog QPushButton:hover, CreationDialog QPushButton:hover
{
background-color: #b1b7ff;
border-color: #3543e7;
color: black;
background-color: #3543e7;
color: #baff0c;
}

QComboBox
{
width: 80px;
width: 70px;
color: white;
background-color: #3543e7;
background-color: #181d5a;

border-style: outset;
border-width: 2px;
border-color: #b1b7ff;
border-radius: 3px;
}
QComboBox::drop-down

QComboBox:checked
{
background-color: #3543e7;
color: #baff0c;
}

QComboBox QAbstractItemView
{
border-width: 3px;
border-color: #b1b7ff;
border-radius: 3px;
border-style: outset;
color: black;
selection-background-color: #181d5a;
}

QComboBox::drop-down
{
width: 15px;
color: white;
border-color: #b1b7ff;
border-radius: 3px;
padding-left: 10px;
}

QComboBox::down-arrow, QSpinBox::down-arrow, QTimeEdit::down-arrow, QDateEdit::down-arrow
{
image: url(:/icons/down_arrow.png);
}

/* ------------------------------------------------------------------------------ */

LoadDialog, LaunchWidget, CreationDialog
{
background-image: url(Resources/Icons/StartMenuBackground.png);
Expand Down
8 changes: 4 additions & 4 deletions src/GUI/translations/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,22 @@
<translation type="vanished">Загрузить проект</translation>
</message>
<message>
<location filename="../GreetingWidget.cpp" line="26"/>
<location filename="../GreetingWidget.cpp" line="27"/>
<source>New Project</source>
<translation>Новый проект</translation>
</message>
<message>
<location filename="../GreetingWidget.cpp" line="33"/>
<location filename="../GreetingWidget.cpp" line="34"/>
<source>Load Project</source>
<translation>Загрузить проект</translation>
</message>
<message>
<location filename="../GreetingWidget.cpp" line="40"/>
<location filename="../GreetingWidget.cpp" line="41"/>
<source>Language</source>
<translation>Язык</translation>
</message>
<message>
<location filename="../GreetingWidget.cpp" line="63"/>
<location filename="../GreetingWidget.cpp" line="64"/>
<source>Greetings, %username%. You have launched the hotkey editing program for the game Command and Conquer: Generals and Command and Conquer: Generals — Zero Hour. At the moment, the program supports in test mode only the creation of hotkey maps based on pre-prepared hotkeys. We hope that you will like the program.</source>
<translation>Приветствую тебя, %username%. Ты запустил программу редактирования горячих клавиш для игры Command and Conquer: Generals и Command and Conquer: Generals — Zero Hour. На текущий момент программа поддерживает в тестовом режиме только создание карт горячих клавиш на основе заранее подготовленных горячих клавиш. Надеемся, что программа тебе понравится.</translation>
</message>
Expand Down

0 comments on commit f4fc397

Please sign in to comment.