updated theme style function names, removed unused function
This commit is contained in:
parent
c4f21e8a2e
commit
dcdcb6a711
3 changed files with 5 additions and 12 deletions
|
@ -168,7 +168,7 @@ class CanvasNode:
|
|||
is_wlan = self.core_node.type == NodeType.WIRELESS_LAN
|
||||
is_emane = self.core_node.type == NodeType.EMANE
|
||||
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():
|
||||
context.add_command(label="Configure", command=self.show_config)
|
||||
if NodeUtils.is_container_node(self.core_node.type):
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import logging
|
||||
import tkinter as tk
|
||||
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):
|
||||
if not isinstance(event.widget, tk.Menu):
|
||||
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")
|
||||
fg = style.lookup(".", "foreground")
|
||||
abg = style.lookup(".", "lightcolor")
|
||||
|
@ -165,7 +158,7 @@ def update_menu(style, widget):
|
|||
)
|
||||
|
||||
|
||||
def update_listbox(widget):
|
||||
def style_listbox(widget):
|
||||
style = ttk.Style()
|
||||
bg = style.lookup(".", "background")
|
||||
fg = style.lookup(".", "foreground")
|
||||
|
|
|
@ -185,7 +185,7 @@ class ListboxScroll(ttk.Frame):
|
|||
self.listbox = tk.Listbox(
|
||||
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.scrollbar.config(command=self.listbox.yview)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue