Skip to content

Commit

Permalink
ViewManager: Set center docked view size policy to expand
Browse files Browse the repository at this point in the history
  • Loading branch information
mborgerson committed Sep 21, 2023
1 parent bd8fef7 commit ef003c3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion angrmanagement/ui/view_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import PySide6QtAds as QtAds
from bidict import bidict
from PySide6.QtWidgets import QSizePolicy

from .views.view import ViewStatePublisherMixin

Expand Down Expand Up @@ -81,13 +82,19 @@ def add_view(self, view: "BaseView") -> None:
dw.setWidget(view)

area = self.DOCKING_POSITIONS.get(view.default_docking_position, QtAds.RightDockWidgetArea)
self.main_window.dock_manager.addDockWidgetTab(area, dw)
area_widget = self.main_window.dock_manager.addDockWidgetTab(area, dw)
self.main_window.init_shortcuts_on_dock(dw)

self.views.append(view)
self.docks.append(dw)
self.view_to_dock[view] = dw

if view.default_docking_position == "center":
policy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
policy.setHorizontalStretch(1)
policy.setVerticalStretch(1)
area_widget.setSizePolicy(policy)

@property
def most_recently_focused_view(self) -> Optional["BaseView"]:
if self.views_by_activation:
Expand Down

0 comments on commit ef003c3

Please sign in to comment.