Skip to content

Commit

Permalink
minor repositioning, updating to the proper icons
Browse files Browse the repository at this point in the history
  • Loading branch information
lindakladivova committed May 10, 2024
1 parent 2f6e1b5 commit 03857f7
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions gui/wxpython/history/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ def _layout(self):
def _initImages(self):
bmpsize = (16, 16)
self.icons = {
"check": MetaIcon(img="check").GetBitmap(bmpsize),
"cross": MetaIcon(img="check").GetBitmap(bmpsize),
"check": MetaIcon(img="success").GetBitmap(bmpsize),
"cross": MetaIcon(img="cross").GetBitmap(bmpsize),
}

def _createGeneralInfoBox(self):
Expand Down Expand Up @@ -141,15 +141,18 @@ def _createRegionSettingsBox(self):
self.region_settings_box, wx.VERTICAL
)

self.sizer_region_settings_grid = wx.GridBagSizer(hgap=0, vgap=0)
self.sizer_region_settings_grid.SetCols(2)
self.sizer_region_settings_grid.SetRows(9)

self.sizer_region_settings_match = wx.BoxSizer(wx.HORIZONTAL)
self.region_settings_box_sizer.Add(
self.sizer_region_settings_match, proportion=0, flag=wx.EXPAND, border=5
self.sizer_region_settings_match,
proportion=0,
flag=wx.ALL | wx.EXPAND,
border=5,
)

self.sizer_region_settings_grid = wx.GridBagSizer(hgap=0, vgap=0)
self.sizer_region_settings_grid.SetCols(2)
self.sizer_region_settings_grid.SetRows(9)

self.region_settings_box_sizer.Add(
self.sizer_region_settings_grid,
proportion=1,
Expand Down Expand Up @@ -238,13 +241,13 @@ def _updateRegionSettingsBox(self, command_info):
self.sizer_region_settings_match.Clear(True)

status_text = _("Region match")
button_label = None

if self.region_settings != self._get_current_region():
icon = self.icons["cross"]
button_label = _("Update current region")
else:
icon = self.icons["check"]
button_label = None

# Static text
textRegionMatch = StaticText(
Expand All @@ -255,27 +258,28 @@ def _updateRegionSettingsBox(self, command_info):
self.sizer_region_settings_match.Add(
textRegionMatch,
proportion=0,
flag=wx.ALL | wx.EXPAND,
border=15,
flag=wx.ALIGN_CENTER_VERTICAL | wx.RIGHT,
border=10,
)

# Static bitmap for icon
iconRegionMatch = wx.StaticBitmap(self.region_settings_box, bitmap=icon)
self.sizer_region_settings_match.Add(
iconRegionMatch,
proportion=0,
flag=wx.ALL | wx.EXPAND,
border=5,
flag=wx.ALIGN_CENTER_VERTICAL | wx.RIGHT,
border=10,
)

if button_label:
# Button for region update
buttonUpdateRegion = wx.Button(self.region_settings_box, label=button_label)
buttonUpdateRegion.Bind(wx.EVT_BUTTON, self.OnUpdateRegion)
self.sizer_region_settings_match.Add(
buttonUpdateRegion,
proportion=1,
flag=wx.ALL | wx.EXPAND,
border=5,
flag=wx.ALIGN_CENTER_VERTICAL,
border=10,
)

self.region_settings_box.Layout()
Expand Down

0 comments on commit 03857f7

Please sign in to comment.