Skip to content

Commit

Permalink
Add QTabWidget styling in the HotkeyMainWindow
Browse files Browse the repository at this point in the history
  • Loading branch information
MahBoiDeveloper committed Apr 24, 2024
1 parent 7490d5f commit ba8a4d0
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 25 deletions.
4 changes: 3 additions & 1 deletion src/GUI/HotkeysMainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,11 @@ HotkeysMainWindow::HotkeysMainWindow(const QVariant& configuration, QWidget* par
// Fill all available space
pHotkeysArea->setWidgetResizable(true);

QScrollArea* pKeyboardWindow = new QScrollArea();

QVBoxLayout* ltBuildingConfiguration = new QVBoxLayout();
ltBuildingConfiguration->addWidget(pHotkeysArea, 2);
ltBuildingConfiguration->addWidget(new QScrollArea, 1);
ltBuildingConfiguration->addWidget(pKeyboardWindow, 1);

QHBoxLayout* ltContent = new QHBoxLayout();
ltContent->addWidget(pEntitiesTreeWidget, 4);
Expand Down
60 changes: 47 additions & 13 deletions src/GUI/Theme/Styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
/* 1. https://doc.qt.io/qt-5/stylesheet-syntax.html */
/* 2. https://doc.qt.io/qt-5/stylesheet-reference.html */
/* 3. https://forum.qt.io/topic/40151/solved-scaled-background-image-using-stylesheet/3 */
/* Global style setting */

/* Global style setting */
*
{
font-family: "Consolas";
Expand Down Expand Up @@ -69,7 +69,7 @@ BaseConfigurationDialog QPushButton
padding-right: 30px;
}

GreetingWidget QPushButton, LoadDialog QPushButton, CreationDialog QPushButton, HotkeysMainWindow QPushButton
GreetingWidget QPushButton, LoadDialog QPushButton, CreationDialog QPushButton
{
font-family: Calibri;
font-weight: bold;
Expand Down Expand Up @@ -111,11 +111,19 @@ HotkeysMainWindow
background-color: black;
}

HotkeysMainWindow, HotkeysMainWindow#QVBoxLayout, HotkeysMainWindow#QHBoxLayout, HotkeysMainWindow#QBoxLayout, HotkeysMainWindow#QWidget,
ActionHotkeyWidget, ActionHotkeyWidget#QVBoxLayout, ActionHotkeyWidget#QHBoxLayout, ActionHotkeyWidget#QBoxLayout, ActionHotkeyWidget#QWidget
HotkeysMainWindow QPushButton
{
background-color: black;
font-family: Calibri;
font-weight: bold;
padding: 10px;

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

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

HotkeysMainWindow QPushButton:hover
Expand All @@ -136,19 +144,45 @@ HotkeysMainWindow QPushButton:pressed:hover
color: #baff0c;
}

HotkeysMainWindow QTreeWidget, HotkeyMainWindow QWidget,
HotkeyMainWindow QHBoxLayout, HotkeyMainWindow QVBoxLayout,
HotkeyMainWindow QScrollArea, HotkeyMainWindow QTabWidget,
ActionHotkeyWidget QWidget,
HotkeyMainWindow QTabWidget::QLayout,
HotkeyMainWindow QTabWidget::QVBoxLayout,
QVBoxLayout#hotkeysLayout
HotkeysMainWindow QTreeWidget, HotkeysMainWindow QScrollArea, HotkeysMainWindow QTabWidget
{
background: rgba(0, 0, 0, 0.7);
border-radius: 3px;
border-width: 5px;
border-width: 1px;
border-style: outset;
border-color: white;

color: white;
}

QTabWidget::pane
{
background: rgba(0, 0, 0, 0);
color: white;
border: none;
}

QTabWidget QWidget
{
background: rgba(0, 0, 0, 0);
color: white;
border: none;
}

/* Maybe useful in near future */
/* HotkeysMainWindow QMenu
{
background: rgba(0, 0, 0, 0);
color: white;
border: none;
} */

QTabBar::tab
{
min-height: 15px;
min-width: 30px;
color: white;
border: none;
}

HotkeysMainWindow QTreeWidget::item
Expand Down
22 changes: 11 additions & 11 deletions src/GUI/translations/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,48 +104,48 @@
<context>
<name>HotkeysMainWindow</name>
<message>
<location filename="../HotkeysMainWindow.cpp" line="125"/>
<location filename="../HotkeysMainWindow.cpp" line="127"/>
<source>File</source>
<translation>Файл</translation>
</message>
<message>
<location filename="../HotkeysMainWindow.cpp" line="126"/>
<location filename="../HotkeysMainWindow.cpp" line="128"/>
<source>Special</source>
<translation>Доп</translation>
</message>
<message>
<location filename="../HotkeysMainWindow.cpp" line="128"/>
<location filename="../HotkeysMainWindow.cpp" line="130"/>
<source>View</source>
<translation>Вид</translation>
</message>
<message>
<location filename="../HotkeysMainWindow.cpp" line="130"/>
<location filename="../HotkeysMainWindow.cpp" line="132"/>
<source>Settings</source>
<translation>Настройки</translation>
</message>
<message>
<location filename="../HotkeysMainWindow.cpp" line="133"/>
<location filename="../HotkeysMainWindow.cpp" line="367"/>
<location filename="../HotkeysMainWindow.cpp" line="135"/>
<location filename="../HotkeysMainWindow.cpp" line="369"/>
<source>About</source>
<translation>О программе</translation>
</message>
<message>
<location filename="../HotkeysMainWindow.cpp" line="259"/>
<location filename="../HotkeysMainWindow.cpp" line="261"/>
<source>Layout %1</source>
<translation>Раскладка %1</translation>
</message>
<message>
<location filename="../HotkeysMainWindow.cpp" line="352"/>
<location filename="../HotkeysMainWindow.cpp" line="354"/>
<source>Authors: </source>
<translation>Авторы: </translation>
</message>
<message>
<location filename="../HotkeysMainWindow.cpp" line="353"/>
<location filename="../HotkeysMainWindow.cpp" line="355"/>
<source>Version: </source>
<translation>Версия: </translation>
</message>
<message>
<location filename="../HotkeysMainWindow.cpp" line="354"/>
<location filename="../HotkeysMainWindow.cpp" line="356"/>
<source>Program licensed with </source>
<translation>Программа лицензирована под </translation>
</message>
Expand All @@ -154,7 +154,7 @@
<translation type="vanished">Программа лицензирована под лицензией GNU GPL v3</translation>
</message>
<message>
<location filename="../HotkeysMainWindow.cpp" line="355"/>
<location filename="../HotkeysMainWindow.cpp" line="357"/>
<source>GitHub Repository</source>
<translation>Репозиторий на GitHub</translation>
</message>
Expand Down

0 comments on commit ba8a4d0

Please sign in to comment.