Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Highlights selected tab in main window #9160

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/ert/gui/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from qtpy.QtGui import QCloseEvent, QCursor, QIcon
from qtpy.QtWidgets import (
QAction,
QButtonGroup,
QFrame,
QHBoxLayout,
QMainWindow,
Expand Down Expand Up @@ -50,13 +51,15 @@
BUTTON_STYLE_SHEET
+ """
QToolButton:hover {background-color: rgba(50, 50, 50, 90);}
QToolButton:checked {background-color: rgba(50, 50, 50, 120);}
"""
)

BUTTON_STYLE_SHEET_DARK: str = (
BUTTON_STYLE_SHEET
+ """
QToolButton:hover {background-color: rgba(30, 30, 30, 150);}
QToolButton:checked {background-color: rgba(30, 30, 30, 120);}
"""
)

Expand Down Expand Up @@ -87,6 +90,7 @@ def __init__(
self.central_widget.setLayout(self.central_layout)
self.facade = LibresFacade(self.ert_config)
self.side_frame = QFrame(self)
self.button_group = QButtonGroup(self.side_frame)

if self.is_dark_mode():
self.side_frame.setStyleSheet("background-color: rgb(64, 64, 64);")
Expand Down Expand Up @@ -233,6 +237,7 @@ def post_init(self) -> None:

def _add_sidebar_button(self, name: str, icon: QIcon) -> QToolButton:
button = QToolButton(self.side_frame)
button.setCheckable(True)
button.setFixedSize(85, 95)
button.setCursor(QCursor(Qt.CursorShape.PointingHandCursor))

Expand All @@ -254,6 +259,7 @@ def _add_sidebar_button(self, name: str, icon: QIcon) -> QToolButton:

button.clicked.connect(self.select_central_widget)
button.setProperty("index", name)
self.button_group.addButton(button)
return button

def __add_help_menu(self) -> None:
Expand Down