add icons in kontex menüs

This commit is contained in:
2025-08-13 01:24:55 +02:00
parent ba6ef7385a
commit 8b4068fdc7
4 changed files with 20 additions and 8 deletions

View File

@@ -16,6 +16,9 @@ Changelog for shared_libs
- Reduced redundancy, logviewer fulll removed , add log_window and menu_bar - Reduced redundancy, logviewer fulll removed , add log_window and menu_bar
- replace tooltip animation with exist tooltip, search optimized, add new icons
copy and stair (for path folllow)
### Added ### Added
01.08.2025 01.08.2025

View File

@@ -693,8 +693,8 @@ class IconManager:
'back_large': '48/arrow-left.png', 'back_large': '48/arrow-left.png',
'forward_large': '48/arrow-right.png', 'forward_large': '48/arrow-right.png',
'up_large': '48/arrow-up.png', 'up_large': '48/arrow-up.png',
'copy': '48/copy.png', 'copy_large': '48/copy.png',
'stair': '48/stair.png', 'stair_large': '48/stair.png',
'icon_view_large': '48/carrel.png', 'icon_view_large': '48/carrel.png',
'computer_large': '48/computer.png', 'computer_large': '48/computer.png',
'device_large': '48/device.png', 'device_large': '48/device.png',
@@ -742,8 +742,8 @@ class IconManager:
'back_extralarge': '64/arrow-left.png', 'back_extralarge': '64/arrow-left.png',
'forward_extralarge': '64/arrow-right.png', 'forward_extralarge': '64/arrow-right.png',
'up_extralarge': '64/arrow-up.png', 'up_extralarge': '64/arrow-up.png',
'copy': '64/copy.png', 'copy_extralarge': '64/copy.png',
'stair': '64/stair.png', 'stairextralarge': '64/stair.png',
'audio_large': '64/audio.png', 'audio_large': '64/audio.png',
'icon_view_extralarge': '64/carrel.png', 'icon_view_extralarge': '64/carrel.png',
'computer_extralarge': '64/computer.png', 'computer_extralarge': '64/computer.png',

View File

@@ -167,13 +167,16 @@ class FileOperationsManager:
activebackground=self.dialog.style_manager.selection_color, activeforeground=self.dialog.style_manager.color_foreground, relief='flat', borderwidth=0) activebackground=self.dialog.style_manager.selection_color, activeforeground=self.dialog.style_manager.color_foreground, relief='flat', borderwidth=0)
self.dialog.context_menu.add_command(label=LocaleStrings.UI["copy_filename_to_clipboard"], self.dialog.context_menu.add_command(label=LocaleStrings.UI["copy_filename_to_clipboard"],
command=lambda: self._copy_to_clipboard(os.path.basename(item_path))) command=lambda: self._copy_to_clipboard(os.path.basename(item_path)),
image=self.dialog.icon_manager.get_icon('copy'), compound='left')
self.dialog.context_menu.add_command( self.dialog.context_menu.add_command(
label=LocaleStrings.UI["copy_path_to_clipboard"], command=lambda: self._copy_to_clipboard(item_path)) label=LocaleStrings.UI["copy_path_to_clipboard"], command=lambda: self._copy_to_clipboard(item_path),
image=self.dialog.icon_manager.get_icon('copy'), compound='left')
self.dialog.context_menu.add_separator() self.dialog.context_menu.add_separator()
self.dialog.context_menu.add_command( self.dialog.context_menu.add_command(
label=LocaleStrings.UI["open_file_location"], command=lambda: self._open_file_location_from_context(item_path)) label=LocaleStrings.UI["open_file_location"], command=lambda: self._open_file_location_from_context(item_path),
image=self.dialog.icon_manager.get_icon('stair'), compound='left')
self.dialog.context_menu.tk_popup(event.x_root, event.y_root) self.dialog.context_menu.tk_popup(event.x_root, event.y_root)
return "break" return "break"

View File

@@ -2,6 +2,9 @@ import tkinter as tk
from tkinter import ttk from tkinter import ttk
from datetime import datetime from datetime import datetime
import typing import typing
from shared_libs.common_tools import IconManager
if typing.TYPE_CHECKING: if typing.TYPE_CHECKING:
from tkinter import Event from tkinter import Event
@@ -19,6 +22,8 @@ class LogWindow(ttk.Frame):
""" """
super().__init__(parent) super().__init__(parent)
self.icon_manager = IconManager()
log_container = tk.Frame(self) log_container = tk.Frame(self)
# Let the main app control padding via the grid options # Let the main app control padding via the grid options
log_container.pack(fill="both", expand=True, padx=0, pady=0) log_container.pack(fill="both", expand=True, padx=0, pady=0)
@@ -43,7 +48,8 @@ class LogWindow(ttk.Frame):
log_scrollbar.pack(side="right", fill="y") log_scrollbar.pack(side="right", fill="y")
self.context_menu: tk.Menu = tk.Menu(self, tearoff=0) self.context_menu: tk.Menu = tk.Menu(self, tearoff=0)
self.context_menu.add_command(label=copy, command=self.copy_text) self.context_menu.add_command(
label=copy, command=self.copy_text, image=self.icon_manager.get_icon('copy'), compound='left')
self.log_text.bind("<Button-3>", self.show_context_menu) self.log_text.bind("<Button-3>", self.show_context_menu)
def log_message(self, message: str) -> None: def log_message(self, message: str) -> None: