From 1e2edc2bc8e258360e3858ef100a165b656fb2a8 Mon Sep 17 00:00:00 2001 From: Saeed Rasooli Date: Thu, 21 Mar 2024 17:19:21 +0330 Subject: [PATCH] bug fix in Right Panel: update Customize "Enable" checkbox when toggle via win controller button --- scal3/ui_gtk/customize_dialog.py | 1 + scal3/ui_gtk/right_panel.py | 7 +++++++ scal3/ui_gtk/starcal.py | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/scal3/ui_gtk/customize_dialog.py b/scal3/ui_gtk/customize_dialog.py index 359223880..a3a5cc049 100644 --- a/scal3/ui_gtk/customize_dialog.py +++ b/scal3/ui_gtk/customize_dialog.py @@ -375,6 +375,7 @@ def addPageObj(self, page): ) pack(hbox, prefItem.getWidget()) pack(page.pageWidget, hbox, 0, 0) + item.enablePrefItem = prefItem if item.itemListCustomizable and item.items: self._addPageItemsTree(page) diff --git a/scal3/ui_gtk/right_panel.py b/scal3/ui_gtk/right_panel.py index b0e7f45ed..9eebea63b 100644 --- a/scal3/ui_gtk/right_panel.py +++ b/scal3/ui_gtk/right_panel.py @@ -102,11 +102,18 @@ def __init__(self): styleClass="right-panel-plugins", ) # --- + self.enablePrefItem = None # will be set in customize_dialog.py + # --- self.addItems() # --- self.show_all() self.onBorderWidthChange() + def onToggleFromMainWin(self): + if self.enablePrefItem is None: + return + self.enablePrefItem.set(not self.enablePrefItem.get()) + def appendItem(self, item): CustomizableCalObj.appendItem(self, item) swin = gtk.ScrolledWindow() diff --git a/scal3/ui_gtk/starcal.py b/scal3/ui_gtk/starcal.py index b73a66346..f7f2383da 100755 --- a/scal3/ui_gtk/starcal.py +++ b/scal3/ui_gtk/starcal.py @@ -495,6 +495,10 @@ def _onToggleRightPanel(self): self.rightPanel.enable = enable self.rightPanel.showHide() self.rightPanel.onDateChange() + + # update Enable checkbutton in Customize dialog + self.rightPanel.onToggleFromMainWin() + if ui.mainWinRightPanelResizeOnToggle: ww, wh = self.get_size() mw = ui.mainWinRightPanelWidth