Skip to content

Commit 301b89a

Browse files
committed
Improve toolbar and player tab UI restrictions
Main toolbar is now non-movable, non-floatable, and restricted to top/bottom areas with context menu disabled for a more consistent UI. In the players tab, the player group box is hidden when no players exist to create a seamless placeholder appearance, and shown when players are present.
1 parent 3bf92cd commit 301b89a

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

src/gambitpairing/gui/mainwindow.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,16 @@ def _setup_toolbar(self):
246246
Icons are loaded from the system theme for a native look and feel.
247247
"""
248248
toolbar = self.addToolBar("Main Toolbar")
249+
# Prevent detaching / floating
250+
toolbar.setMovable(False)
251+
try:
252+
toolbar.setFloatable(False)
253+
except Exception:
254+
pass
255+
toolbar.setAllowedAreas(
256+
Qt.ToolBarArea.TopToolBarArea | Qt.ToolBarArea.BottomToolBarArea
257+
) # restrict just in case
258+
toolbar.setContextMenuPolicy(Qt.ContextMenuPolicy.PreventContextMenu)
249259
toolbar.setIconSize(QtCore.QSize(24, 24))
250260
toolbar.setStyleSheet("""
251261
QToolBar {

src/gambitpairing/gui/players_tab.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,9 +581,12 @@ def _update_visibility(self):
581581
self.no_players_placeholder.show()
582582
self.table_players.hide()
583583
self.btn_add_player_detail.hide() # Hide until first player is added
584+
# Hide the group box frame/title to create seamless wall look
585+
self.player_group.hide()
584586
else:
585587
# Tournament with players: show table and add button
586588
self.no_players_placeholder.hide()
589+
self.player_group.show()
587590
self.table_players.show()
588591
self.btn_add_player_detail.show()
589592
tournament_started = len(self.tournament.rounds_pairings_ids) > 0

0 commit comments

Comments
 (0)