Skip to content

Commit

Permalink
API: Style adjustments to status bar widgets per operating system
Browse files Browse the repository at this point in the history
  • Loading branch information
ccordoba12 committed Jul 21, 2024
1 parent 8372b67 commit a9acad7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion spyder/api/widgets/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from spyder.api.widgets.mixins import SpyderWidgetMixin
from spyder.utils.palette import SpyderPalette
from spyder.utils.qthelpers import create_waitspinner
from spyder.utils.stylesheet import MAC


class StatusBarWidget(QWidget, SpyderWidgetMixin):
Expand Down Expand Up @@ -227,7 +228,9 @@ def mouseReleaseEvent(self, event):

if self.INTERACT_ON_CLICK:
self._css.QWidget.setValues(
backgroundColor=SpyderPalette.COLOR_BACKGROUND_5
backgroundColor=SpyderPalette.COLOR_BACKGROUND_4
if MAC
else SpyderPalette.COLOR_BACKGROUND_5
)
self.setStyleSheet(self._css.toString())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from spyder.api.widgets.menus import SpyderMenu
from spyder.api.widgets.status import StatusBarWidget
from spyder.config.base import _
from spyder.utils.stylesheet import MAC


# Main constants
Expand Down Expand Up @@ -82,14 +83,15 @@ def show_menu(self):
# Padding of menu items to left and right
+ 2 * SpyderMenu.HORIZONTAL_PADDING_FOR_ITEMS
)
y_offset = 4 if MAC else 0

metrics = QFontMetrics(self.font())
rect = self.contentsRect()
pos = self.mapToGlobal(
rect.topLeft()
+ QPoint(
-metrics.width(text) // 2 + x_offset,
-2 * self.parent().height(),
-2 * self.parent().height() + y_offset,
)
)

Expand Down

0 comments on commit a9acad7

Please sign in to comment.