Skip to content

Commit

Permalink
Design tweaks (#57)
Browse files Browse the repository at this point in the history
* Fix search appearance on more themes

* Fix maps list appearance on more themes

* Use basic combo box appearance to avoid dark theme issues

* Fix button alignment

* Improve settings button appearance

* Try to fix Close button appearance on mac

* Remove trailing whitespace

* Use lighter background color for settings button
  • Loading branch information
nyalldawson authored Dec 6, 2023
1 parent f601df3 commit 083aedd
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 5 deletions.
44 changes: 43 additions & 1 deletion felt/gui/create_map_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,10 @@ def upload_raster_as_styled_toggled():
self.setting_button.setPopupMode(QToolButton.InstantPopup)
self.setting_button.setStyleSheet(
"""QToolButton::menu-indicator { image: none }
QToolButton { border: 1px solid red; border-radius: 2px; }
QToolButton {
background: #f9f9f9;
border: 1px solid #bdbdbd;
border-radius: 2px; }
"""
)
self.setting_button.setFixedHeight(
Expand All @@ -229,6 +232,45 @@ def upload_raster_as_styled_toggled():
self.maps_widget = RecentMapsWidget()
self.workspace_combo = WorkspacesComboBox()
self.workspace_combo.workspace_changed.connect(self._workspace_changed)
self.workspace_combo.setFixedHeight(
int(QFontMetrics(self.workspace_combo.font()).height() * 1.5)
)
self.workspace_combo.setStyleSheet(
"""
QComboBox{
background: white;
color: black;
selection-background-color: #fed9e3 !important;
selection-color: black !important;
border: 1px solid #bdbdbd;
border-top-right-radius: 2px;
border-top-left-radius: 2px;
border-bottom-right-radius: 2px;
border-bottom-left-radius: 2px;
}
QComboBox:hover {
background: white;
color: black;
selection-background-color: #fed9e3 !important;
selection-color: black !important;
}
QComboBox:on {
background: white;
color: black;
selection-background-color: #fed9e3 !important;
selection-color: black !important;
}
QComboBox QAbstractItemView, QComboBox QListView {
background: white;
color: black;
selection-background-color: #fed9e3 !important;
selection-color: black !important;
}
QComboBox::drop-down:editable:hover {
background-color: @darkalternativegradient;
}
"""
)

maps_layout = QVBoxLayout()
maps_layout.setContentsMargins(0, 0, 0, 0)
Expand Down
4 changes: 2 additions & 2 deletions felt/gui/gui_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@
}
QPushButton {
background: solid #3d521e;
color: white;
background: solid #3d521e !important;
color: white !important;
}
QLineEdit {
Expand Down
15 changes: 14 additions & 1 deletion felt/gui/recent_maps_list_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,11 @@ def __init__(self, parent: Optional[QWidget] = None):
QgsFilterLineEdit{ border-top: 1px solid #bdbdbd;
border-right: 1px solid #bdbdbd;
border-left: 1px solid #bdbdbd;
border-bottom: none;
border-top-right-radius: 2px;
border-top-left-radius: 2px;
border-bottom-right-radius: 0px;
border-bottom-left-radius: 0px;
}"""

def _update_filter_stylesheet():
Expand All @@ -360,7 +363,17 @@ def _update_filter_stylesheet():

self._view = RecentMapsListView()
self._view.setStyleSheet("""
QListView { border: 1px solid #bdbdbd; }
QListView {
border: 1px solid #bdbdbd;
border-top-right-radius: 0px;
border-top-left-radius: 0px;
border-bottom-right-radius: 2px;
border-bottom-left-radius: 2px;
background: white! important;
}
QListView::item::selected {
background-color: #fed9e3;
}
""")

vl.addWidget(self._view, 1)
Expand Down
2 changes: 1 addition & 1 deletion felt/ui/create_map.ui
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,0,0">
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1,0,0">
<item>
<widget class="QLabel" name="footer_label">
<property name="text">
Expand Down

0 comments on commit 083aedd

Please sign in to comment.