updated theme style function names, removed unused function

This commit is contained in:
Blake Harnden 2019-12-16 14:21:30 -08:00
parent c4f21e8a2e
commit dcdcb6a711
3 changed files with 5 additions and 12 deletions

View file

@ -168,7 +168,7 @@ class CanvasNode:
is_wlan = self.core_node.type == NodeType.WIRELESS_LAN is_wlan = self.core_node.type == NodeType.WIRELESS_LAN
is_emane = self.core_node.type == NodeType.EMANE is_emane = self.core_node.type == NodeType.EMANE
context = tk.Menu(self.canvas) context = tk.Menu(self.canvas)
themes.update_menu(self.app.style, context) themes.style_menu(self.app.style, context)
if self.app.core.is_runtime(): if self.app.core.is_runtime():
context.add_command(label="Configure", command=self.show_config) context.add_command(label="Configure", command=self.show_config)
if NodeUtils.is_container_node(self.core_node.type): if NodeUtils.is_container_node(self.core_node.type):

View file

@ -1,4 +1,3 @@
import logging
import tkinter as tk import tkinter as tk
from tkinter import ttk from tkinter import ttk
@ -142,19 +141,13 @@ def load(style):
) )
def update_bg(style, event):
logging.info("updating background: %s", event.widget)
bg = style.lookup(".", "background")
event.widget.config(background=bg)
def theme_change_menu(style, event): def theme_change_menu(style, event):
if not isinstance(event.widget, tk.Menu): if not isinstance(event.widget, tk.Menu):
return return
update_menu(style, event.widget) style_menu(style, event.widget)
def update_menu(style, widget): def style_menu(style, widget):
bg = style.lookup(".", "background") bg = style.lookup(".", "background")
fg = style.lookup(".", "foreground") fg = style.lookup(".", "foreground")
abg = style.lookup(".", "lightcolor") abg = style.lookup(".", "lightcolor")
@ -165,7 +158,7 @@ def update_menu(style, widget):
) )
def update_listbox(widget): def style_listbox(widget):
style = ttk.Style() style = ttk.Style()
bg = style.lookup(".", "background") bg = style.lookup(".", "background")
fg = style.lookup(".", "foreground") fg = style.lookup(".", "foreground")

View file

@ -185,7 +185,7 @@ class ListboxScroll(ttk.Frame):
self.listbox = tk.Listbox( self.listbox = tk.Listbox(
self, selectmode=tk.SINGLE, yscrollcommand=self.scrollbar.set self, selectmode=tk.SINGLE, yscrollcommand=self.scrollbar.set
) )
themes.update_listbox(self.listbox) themes.style_listbox(self.listbox)
self.listbox.grid(row=0, column=0, sticky="nsew") self.listbox.grid(row=0, column=0, sticky="nsew")
self.scrollbar.config(command=self.listbox.yview) self.scrollbar.config(command=self.listbox.yview)