From 774f7d0a5c6cfe38965f92a95083c5b415eda027 Mon Sep 17 00:00:00 2001 From: hwf1324 <1398969445@qq.com> Date: Fri, 22 Mar 2024 14:02:49 +0800 Subject: [PATCH 1/4] Fix description TextCtrl size --- addon/globalPlugins/evtTracker.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addon/globalPlugins/evtTracker.py b/addon/globalPlugins/evtTracker.py index 0995925..83f1ef1 100644 --- a/addon/globalPlugins/evtTracker.py +++ b/addon/globalPlugins/evtTracker.py @@ -7,7 +7,7 @@ from typing import Optional, List from gui.dpiScalingHelper import DpiScalingHelperMixinWithoutInit -import gui +import gui.guiHelper import globalPluginHandler import globalVars from logHandler import log @@ -251,7 +251,8 @@ def __init__(self, eventHistory): wx.TextCtrl, style=wx.TE_MULTILINE | wx.TE_READONLY | wx.TE_DONTWRAP ) - contentsSizer.Add(self.description.sizer) + self.description.sizer.GetItem(self.description.control).SetProportion(1) + contentsSizer.Add(self.description.sizer, flag=wx.EXPAND) mainSizer.Add(contentsSizer, border=gui.guiHelper.BORDER_FOR_DIALOGS, flag=wx.ALL) mainSizer.Fit(self) From 0341a1edc11f5825b5482506f80eb19ef66c263c Mon Sep 17 00:00:00 2001 From: hwf1324 <1398969445@qq.com> Date: Fri, 22 Mar 2024 14:14:49 +0800 Subject: [PATCH 2/4] Increase the horizontal size of TextCtrl --- addon/globalPlugins/evtTracker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addon/globalPlugins/evtTracker.py b/addon/globalPlugins/evtTracker.py index 83f1ef1..fe0258b 100644 --- a/addon/globalPlugins/evtTracker.py +++ b/addon/globalPlugins/evtTracker.py @@ -247,7 +247,7 @@ def __init__(self, eventHistory): self.description = gui.guiHelper.LabeledControlHelper( self, # Translators: label for a read-only edit field displaying event properties. - _("Event &description"), + _("Event\n&description"), wx.TextCtrl, style=wx.TE_MULTILINE | wx.TE_READONLY | wx.TE_DONTWRAP ) From 16d950609f4d724c25a0745e5c4e91dc9c5220dd Mon Sep 17 00:00:00 2001 From: Luke Davis Date: Fri, 22 Mar 2024 05:03:11 -0400 Subject: [PATCH 3/4] Move some imports around --- addon/globalPlugins/evtTracker.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/addon/globalPlugins/evtTracker.py b/addon/globalPlugins/evtTracker.py index 19cff22..f298031 100644 --- a/addon/globalPlugins/evtTracker.py +++ b/addon/globalPlugins/evtTracker.py @@ -5,9 +5,11 @@ from comtypes import COMError from collections import deque from typing import Optional, List +import wx from gui.dpiScalingHelper import DpiScalingHelperMixinWithoutInit -import gui.guiHelper +import gui +from gui import guiHelper import globalPluginHandler import globalVars from logHandler import log @@ -15,7 +17,6 @@ from NVDAObjects.UIA import UIA import NVDAObjects from scriptHandler import script -import wx # Security: disable the global plugin altogether in secure mode. @@ -243,8 +244,8 @@ def __init__(self, eventHistory): ) self.list.Bind(wx.EVT_LISTBOX, self.onListItemSelected) contentsSizer.Add(self.list, flag=wx.EXPAND) - contentsSizer.AddSpacer(gui.guiHelper.SPACE_BETWEEN_VERTICAL_DIALOG_ITEMS) - self.description = gui.guiHelper.LabeledControlHelper( + contentsSizer.AddSpacer(guiHelper.SPACE_BETWEEN_VERTICAL_DIALOG_ITEMS) + self.description = guiHelper.LabeledControlHelper( self, # Translators: label for a read-only edit field displaying event properties. _("Event\n&description"), @@ -254,7 +255,7 @@ def __init__(self, eventHistory): self.description.sizer.GetItem(self.description.control).SetProportion(1) contentsSizer.Add(self.description.sizer, flag=wx.EXPAND) - mainSizer.Add(contentsSizer, border=gui.guiHelper.BORDER_FOR_DIALOGS, flag=wx.ALL) + mainSizer.Add(contentsSizer, border=guiHelper.BORDER_FOR_DIALOGS, flag=wx.ALL) mainSizer.Fit(self) self.SetSizer(mainSizer) self.CentreOnScreen() From a8ce1b98606fe728fbe1581d73259093074826cf Mon Sep 17 00:00:00 2001 From: hwf1324 <1398969445@qq.com> Date: Fri, 22 Mar 2024 20:31:21 +0800 Subject: [PATCH 4/4] Reduce the height of the ListBox --- addon/globalPlugins/evtTracker.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/addon/globalPlugins/evtTracker.py b/addon/globalPlugins/evtTracker.py index f298031..bd27999 100644 --- a/addon/globalPlugins/evtTracker.py +++ b/addon/globalPlugins/evtTracker.py @@ -232,14 +232,15 @@ def __init__(self, eventHistory): super().__init__( parent=gui.mainFrame, # Translators: title of a dialog displaying recent events. - title=_("Events List") + title=_("Events List"), + size=(536, 428) # height is chosen to ensure the dialog will fit on an 800x600 screen, ) self.eventHistory = eventHistory mainSizer = wx.BoxSizer(wx.VERTICAL) contentsSizer = wx.BoxSizer(wx.VERTICAL) self.list = wx.ListBox( self, - size=self.scaleSize((500, 300)), # height is chosen to ensure the dialog will fit on an 800x600 screen, + size=self.scaleSize((500, 200)), style=wx.LB_SINGLE ) self.list.Bind(wx.EVT_LISTBOX, self.onListItemSelected) @@ -253,10 +254,10 @@ def __init__(self, eventHistory): style=wx.TE_MULTILINE | wx.TE_READONLY | wx.TE_DONTWRAP ) self.description.sizer.GetItem(self.description.control).SetProportion(1) + self.description.sizer.GetItem(self.description.control).SetFlag(wx.EXPAND) contentsSizer.Add(self.description.sizer, flag=wx.EXPAND) - mainSizer.Add(contentsSizer, border=guiHelper.BORDER_FOR_DIALOGS, flag=wx.ALL) - mainSizer.Fit(self) + mainSizer.Add(contentsSizer, proportion=1, border=guiHelper.BORDER_FOR_DIALOGS, flag=wx.ALL) self.SetSizer(mainSizer) self.CentreOnScreen() self._createEventsList()