Skip to content

Commit

Permalink
Merge pull request #5671 from OpenShot/improved-theme-combobox
Browse files Browse the repository at this point in the history
Improvements to Cosmic Dusk Theme
  • Loading branch information
jonoomph authored Dec 19, 2024
2 parents f1b4a1e + 57a9c1b commit 9f7e0ee
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 11 deletions.
15 changes: 14 additions & 1 deletion src/themes/cosmic/theme.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ def __init__(self, app):
color: #91C3FF;
padding-top: 10px;
padding-bottom: 10px;
border: none;
}
QToolBar#toolBar QToolButton:hover {
Expand Down Expand Up @@ -274,6 +275,11 @@ def __init__(self, app):
color: rgba(145, 195, 255, 0.4);
}
QTabWidget#exportTabs QTabBar::tab,
QTabWidget#tabCategories QTabBar::tab {
margin-bottom: 10px;
}
QTabBar::tab:selected {
color: rgba(145, 195, 255, 1.0);
}
Expand Down Expand Up @@ -343,6 +349,7 @@ def __init__(self, app):
padding: 6px;
padding-left: 8px;
padding-right: 8px;
combobox-popup: 0;
}
QComboBox::drop-down {
Expand Down Expand Up @@ -416,6 +423,7 @@ def __init__(self, app):
QToolBox::tab {
color: #91C3FF;
border-top: 1px solid rgba(145, 195, 255, .2);
}
QTabWidget QWidget#pageAdvancedOptions, QWidget#pageProfile, QWidget#pageImageSequenceSettings, QWidget#pageVideoSettings, QWidget#pageAudioSettings {
Expand Down Expand Up @@ -473,6 +481,10 @@ def __init__(self, app):
background-color: #0078FF;
color: #FFFFFF;
}}
QMessageBox QPushButton[text="&{_('Cancel')}"] {{
qproperty-icon: none;
}}
""" + self.style_sheet.replace("{PATH}", f"{path_unix_slashes}/")

def apply_theme(self):
Expand Down Expand Up @@ -519,7 +531,8 @@ def apply_theme(self):
{"action": self.app.window.actionProfile, "icon": "themes/cosmic/images/tool-profile.svg", "style": Qt.ToolButtonTextBesideIcon},
{"expand": True},
{"action": self.app.window.actionSave, "icon": "themes/cosmic/images/tool-save-project.svg", "style": Qt.ToolButtonTextBesideIcon},
{"action": self.app.window.actionExportVideo, "icon": "themes/cosmic/images/tool-export.svg", "style": Qt.ToolButtonTextBesideIcon, "stylesheet": "QToolButton { background-color: #0078FF; color: #FFFFFF; }"},
{"action": self.app.window.actionExportVideo, "icon": "themes/cosmic/images/tool-export.svg",
"style": Qt.ToolButtonTextBesideIcon, "stylesheet": "QToolButton { background-color: #0078FF; color: #FFFFFF; border: none; } QToolButton:hover, QToolButton:pressed { background-color: #006EE6; }"},
{"action": self.app.window.actionUpdate, "icon": "themes/cosmic/images/warning.svg", "visible": False, "style": Qt.ToolButtonTextBesideIcon, "stylesheet": "QToolButton { background-color: #141923; color: #FABE0A; }"}
]
self.set_toolbar_buttons(self.app.window.toolBar, icon_size=20, settings=toolbar_buttons)
Expand Down
8 changes: 8 additions & 0 deletions src/themes/humanity/theme.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ def __init__(self, app):
height: 24px;
}
QComboBox {
combobox-popup: 0;
}
.property_value {
foreground-color: #217dd4;
background-color: #565656;
Expand Down Expand Up @@ -99,6 +103,10 @@ def __init__(self, app):
QWidget#videoPreview {
background-color: #dedede;
}
QComboBox {
combobox-popup: 0;
}
"""

def apply_theme(self):
Expand Down
10 changes: 2 additions & 8 deletions src/windows/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,6 @@ def __init__(self, *args, **kwargs):
# This exception occurs when there's a problem parsing the Profile file - display a message and continue
log.error("Failed to parse file '%s' as a profile: %s" % (profile_path, e))

# Loop through sorted profiles
for profile_name in sorted(self.profile_names):
# Add to dropdown
self.cboProfile.addItem(self.getProfileName(self.getProfilePath(profile_name)),
self.getProfilePath(profile_name))

# ********* Simple Project Type **********
# load the simple project type dropdown
presets = []
Expand Down Expand Up @@ -790,7 +784,7 @@ def disableControls(self):
self.txtFileName.setEnabled(False)
self.lblFolderPath.setEnabled(False)
self.txtExportFolder.setEnabled(False)
self.tabWidget.setEnabled(False)
self.exportTabs.setEnabled(False)
self.export_button.setEnabled(False)
self.btnBrowse.setEnabled(False)

Expand All @@ -800,7 +794,7 @@ def enableControls(self):
self.txtFileName.setEnabled(True)
self.lblFolderPath.setEnabled(True)
self.txtExportFolder.setEnabled(True)
self.tabWidget.setEnabled(True)
self.exportTabs.setEnabled(True)
self.export_button.setEnabled(True)
self.btnBrowse.setEnabled(True)

Expand Down
4 changes: 2 additions & 2 deletions src/windows/ui/export.ui
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
</layout>
</item>
<item row="1" column="0">
<widget class="QTabWidget" name="tabWidget">
<widget class="QTabWidget" name="exportTabs">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
Expand Down Expand Up @@ -1064,7 +1064,7 @@
<tabstop>txtFileName</tabstop>
<tabstop>txtExportFolder</tabstop>
<tabstop>btnBrowse</tabstop>
<tabstop>tabWidget</tabstop>
<tabstop>exportTabs</tabstop>
<tabstop>cboSimpleProjectType</tabstop>
<tabstop>cboSimpleTarget</tabstop>
<tabstop>cboSimpleVideoProfile</tabstop>
Expand Down

0 comments on commit 9f7e0ee

Please sign in to comment.