fixed stuff with theming, should look the same on windows and linux now!
This commit is contained in:
@@ -19,6 +19,7 @@ class NotesDialog(wx.Frame):
|
||||
style=wx.DEFAULT_FRAME_STYLE)
|
||||
|
||||
self.parent = parent
|
||||
self.theme = getattr(parent, "theme", None)
|
||||
self.notes_data = notes_data or defaultdict(dict)
|
||||
self.current_note_key = None
|
||||
self.updating_title = False
|
||||
@@ -27,7 +28,7 @@ class NotesDialog(wx.Frame):
|
||||
self.last_save_time = time.time()
|
||||
self.auto_save_interval = 2 # seconds - reduced for immediate saving
|
||||
|
||||
self.SetBackgroundColour(wx.Colour(245, 245, 245))
|
||||
self.SetBackgroundColour(self.get_theme_colour("window_bg", wx.SystemSettings().GetColour(wx.SYS_COLOUR_WINDOW)))
|
||||
|
||||
# Set icon if parent has one
|
||||
if parent:
|
||||
@@ -60,6 +61,11 @@ class NotesDialog(wx.Frame):
|
||||
def close_parent(self, pId):
|
||||
if self.GetParent().GetId() == pId:
|
||||
self.GetParent().Close()
|
||||
|
||||
def get_theme_colour(self, key, fallback):
|
||||
if self.theme and key in self.theme:
|
||||
return self.theme[key]
|
||||
return fallback
|
||||
|
||||
def create_controls(self):
|
||||
# Create menu bar
|
||||
@@ -72,6 +78,7 @@ class NotesDialog(wx.Frame):
|
||||
|
||||
# Left panel - notes list
|
||||
left_panel = wx.Panel(splitter)
|
||||
left_panel.SetBackgroundColour(self.get_theme_colour("sidebar_bg", left_panel.GetBackgroundColour()))
|
||||
left_sizer = wx.BoxSizer(wx.VERTICAL)
|
||||
|
||||
notes_label = wx.StaticText(left_panel, label="Your Notes:")
|
||||
@@ -101,6 +108,7 @@ class NotesDialog(wx.Frame):
|
||||
|
||||
# Right panel - editor
|
||||
right_panel = wx.Panel(splitter)
|
||||
right_panel.SetBackgroundColour(self.get_theme_colour("content_bg", right_panel.GetBackgroundColour()))
|
||||
right_sizer = wx.BoxSizer(wx.VERTICAL)
|
||||
|
||||
title_label = wx.StaticText(right_panel, label="Note Title:")
|
||||
@@ -226,6 +234,7 @@ class NotesDialog(wx.Frame):
|
||||
|
||||
def setup_editor_toolbar(self, parent):
|
||||
self.toolbar = wx.Panel(parent)
|
||||
self.toolbar.SetBackgroundColour(self.get_theme_colour("control_bg", self.toolbar.GetBackgroundColour()))
|
||||
toolbar_sizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||
|
||||
# Text formatting buttons
|
||||
|
||||
Reference in New Issue
Block a user