mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-18 09:57:40 +03:00
"Always on top" option in system menu on Windows.
This commit is contained in:
parent
2ddf72cd31
commit
2ec21209d8
@ -143,8 +143,15 @@ class AppWindow:
|
|||||||
self.edit_menu = tk.Menu(menubar, tearoff=tk.FALSE)
|
self.edit_menu = tk.Menu(menubar, tearoff=tk.FALSE)
|
||||||
self.edit_menu.add_command(label=_('Copy'), accelerator='Ctrl+C', state=tk.DISABLED, command=self.copy) # As in Copy and Paste
|
self.edit_menu.add_command(label=_('Copy'), accelerator='Ctrl+C', state=tk.DISABLED, command=self.copy) # As in Copy and Paste
|
||||||
menubar.add_cascade(label=_('Edit'), menu=self.edit_menu) # Menu title
|
menubar.add_cascade(label=_('Edit'), menu=self.edit_menu) # Menu title
|
||||||
|
if platform == 'win32':
|
||||||
|
self.always_ontop = tk.BooleanVar(value = config.getint('always_ontop'))
|
||||||
|
system_menu = tk.Menu(menubar, name='system', tearoff=tk.FALSE)
|
||||||
|
system_menu.add_separator()
|
||||||
|
system_menu.add_checkbutton(label=_('Always on top'), variable = self.always_ontop, command=self.ontop_changed) # System menu entry on Windows
|
||||||
|
menubar.add_cascade(menu=system_menu)
|
||||||
self.w.bind('<Control-c>', self.copy)
|
self.w.bind('<Control-c>', self.copy)
|
||||||
self.w.protocol("WM_DELETE_WINDOW", self.onexit)
|
self.w.protocol("WM_DELETE_WINDOW", self.onexit)
|
||||||
|
|
||||||
if platform == 'linux2':
|
if platform == 'linux2':
|
||||||
# Fix up menu to use same styling as everything else
|
# Fix up menu to use same styling as everything else
|
||||||
(fg, bg, afg, abg) = (style.lookup('TLabel.label', 'foreground'),
|
(fg, bg, afg, abg) = (style.lookup('TLabel.label', 'foreground'),
|
||||||
@ -157,6 +164,7 @@ class AppWindow:
|
|||||||
self.w['menu'] = menubar
|
self.w['menu'] = menubar
|
||||||
|
|
||||||
# update geometry
|
# update geometry
|
||||||
|
self.ontop_changed()
|
||||||
if config.get('geometry'):
|
if config.get('geometry'):
|
||||||
match = re.match('\+([\-\d]+)\+([\-\d]+)', config.get('geometry'))
|
match = re.match('\+([\-\d]+)\+([\-\d]+)', config.get('geometry'))
|
||||||
if match and (platform!='darwin' or int(match.group(2))>0): # http://core.tcl.tk/tk/tktview/c84f660833546b1b84e7
|
if match and (platform!='darwin' or int(match.group(2))>0): # http://core.tcl.tk/tk/tktview/c84f660833546b1b84e7
|
||||||
@ -478,6 +486,10 @@ class AppWindow:
|
|||||||
self.button['text'] = _('Update') # Update button in main window
|
self.button['text'] = _('Update') # Update button in main window
|
||||||
self.button['state'] = tk.NORMAL
|
self.button['state'] = tk.NORMAL
|
||||||
|
|
||||||
|
def ontop_changed(self, event=None):
|
||||||
|
config.set('always_ontop', self.always_ontop.get())
|
||||||
|
self.w.wm_attributes('-topmost', self.always_ontop.get())
|
||||||
|
|
||||||
def copy(self, event=None):
|
def copy(self, event=None):
|
||||||
if self.system['text']:
|
if self.system['text']:
|
||||||
self.w.clipboard_clear()
|
self.w.clipboard_clear()
|
||||||
|
@ -10,6 +10,9 @@
|
|||||||
/* Explorer rank. [stats.py] */
|
/* Explorer rank. [stats.py] */
|
||||||
"Aimless" = "Total planlos";
|
"Aimless" = "Total planlos";
|
||||||
|
|
||||||
|
/* System menu entry on Windows. [EDMarketConnector.py] */
|
||||||
|
"Always on top" = "Immer im Vordergrund";
|
||||||
|
|
||||||
/* CQC rank. [stats.py] */
|
/* CQC rank. [stats.py] */
|
||||||
"Amateur" = "Anfänger";
|
"Amateur" = "Anfänger";
|
||||||
|
|
||||||
|
@ -10,6 +10,9 @@
|
|||||||
/* Explorer rank. [stats.py] */
|
/* Explorer rank. [stats.py] */
|
||||||
"Aimless" = "Aimless";
|
"Aimless" = "Aimless";
|
||||||
|
|
||||||
|
/* System menu entry on Windows. [EDMarketConnector.py] */
|
||||||
|
"Always on top" = "Always on top";
|
||||||
|
|
||||||
/* CQC rank. [stats.py] */
|
/* CQC rank. [stats.py] */
|
||||||
"Amateur" = "Amateur";
|
"Amateur" = "Amateur";
|
||||||
|
|
||||||
|
@ -10,6 +10,9 @@
|
|||||||
/* Explorer rank. [stats.py] */
|
/* Explorer rank. [stats.py] */
|
||||||
"Aimless" = "Perdido";
|
"Aimless" = "Perdido";
|
||||||
|
|
||||||
|
/* System menu entry on Windows. [EDMarketConnector.py] */
|
||||||
|
"Always on top" = "Siempre visible";
|
||||||
|
|
||||||
/* CQC rank. [stats.py] */
|
/* CQC rank. [stats.py] */
|
||||||
"Amateur" = "Aficionado";
|
"Amateur" = "Aficionado";
|
||||||
|
|
||||||
|
@ -10,6 +10,9 @@
|
|||||||
/* Explorer rank. [stats.py] */
|
/* Explorer rank. [stats.py] */
|
||||||
"Aimless" = "Vagabond";
|
"Aimless" = "Vagabond";
|
||||||
|
|
||||||
|
/* System menu entry on Windows. [EDMarketConnector.py] */
|
||||||
|
"Always on top" = "Toujours visible";
|
||||||
|
|
||||||
/* CQC rank. [stats.py] */
|
/* CQC rank. [stats.py] */
|
||||||
"Amateur" = "Amateur";
|
"Amateur" = "Amateur";
|
||||||
|
|
||||||
|
@ -10,6 +10,9 @@
|
|||||||
/* Explorer rank. [stats.py] */
|
/* Explorer rank. [stats.py] */
|
||||||
"Aimless" = "Aimless";
|
"Aimless" = "Aimless";
|
||||||
|
|
||||||
|
/* System menu entry on Windows. [EDMarketConnector.py] */
|
||||||
|
"Always on top" = "Sempre in primo piano";
|
||||||
|
|
||||||
/* CQC rank. [stats.py] */
|
/* CQC rank. [stats.py] */
|
||||||
"Amateur" = "Amateur";
|
"Amateur" = "Amateur";
|
||||||
|
|
||||||
|
@ -10,6 +10,9 @@
|
|||||||
/* Explorer rank. [stats.py] */
|
/* Explorer rank. [stats.py] */
|
||||||
"Aimless" = "Aimless";
|
"Aimless" = "Aimless";
|
||||||
|
|
||||||
|
/* System menu entry on Windows. [EDMarketConnector.py] */
|
||||||
|
"Always on top" = "Vienmēr virspusē";
|
||||||
|
|
||||||
/* CQC rank. [stats.py] */
|
/* CQC rank. [stats.py] */
|
||||||
"Amateur" = "Amateur";
|
"Amateur" = "Amateur";
|
||||||
|
|
||||||
|
@ -10,6 +10,9 @@
|
|||||||
/* Explorer rank. [stats.py] */
|
/* Explorer rank. [stats.py] */
|
||||||
"Aimless" = "Aimless";
|
"Aimless" = "Aimless";
|
||||||
|
|
||||||
|
/* System menu entry on Windows. [EDMarketConnector.py] */
|
||||||
|
"Always on top" = "Altijd op voorgrond";
|
||||||
|
|
||||||
/* CQC rank. [stats.py] */
|
/* CQC rank. [stats.py] */
|
||||||
"Amateur" = "Amateur";
|
"Amateur" = "Amateur";
|
||||||
|
|
||||||
|
@ -10,6 +10,9 @@
|
|||||||
/* Explorer rank. [stats.py] */
|
/* Explorer rank. [stats.py] */
|
||||||
"Aimless" = "Aimless";
|
"Aimless" = "Aimless";
|
||||||
|
|
||||||
|
/* System menu entry on Windows. [EDMarketConnector.py] */
|
||||||
|
"Always on top" = "Zawsze na wierzchu";
|
||||||
|
|
||||||
/* CQC rank. [stats.py] */
|
/* CQC rank. [stats.py] */
|
||||||
"Amateur" = "Amateur";
|
"Amateur" = "Amateur";
|
||||||
|
|
||||||
|
@ -10,6 +10,9 @@
|
|||||||
/* Explorer rank. [stats.py] */
|
/* Explorer rank. [stats.py] */
|
||||||
"Aimless" = "Бесцельный";
|
"Aimless" = "Бесцельный";
|
||||||
|
|
||||||
|
/* System menu entry on Windows. [EDMarketConnector.py] */
|
||||||
|
"Always on top" = "Поверх остальных окон";
|
||||||
|
|
||||||
/* CQC rank. [stats.py] */
|
/* CQC rank. [stats.py] */
|
||||||
"Amateur" = "Любитель";
|
"Amateur" = "Любитель";
|
||||||
|
|
||||||
|
@ -10,6 +10,9 @@
|
|||||||
/* Explorer rank. [stats.py] */
|
/* Explorer rank. [stats.py] */
|
||||||
"Aimless" = "Aimless";
|
"Aimless" = "Aimless";
|
||||||
|
|
||||||
|
/* System menu entry on Windows. [EDMarketConnector.py] */
|
||||||
|
"Always on top" = "Vedno na vrhu";
|
||||||
|
|
||||||
/* CQC rank. [stats.py] */
|
/* CQC rank. [stats.py] */
|
||||||
"Amateur" = "Amateur";
|
"Amateur" = "Amateur";
|
||||||
|
|
||||||
|
@ -10,6 +10,9 @@
|
|||||||
/* Explorer rank. [stats.py] */
|
/* Explorer rank. [stats.py] */
|
||||||
"Aimless" = "Безцільний";
|
"Aimless" = "Безцільний";
|
||||||
|
|
||||||
|
/* System menu entry on Windows. [EDMarketConnector.py] */
|
||||||
|
"Always on top" = "Zawsze na wierzchu";
|
||||||
|
|
||||||
/* CQC rank. [stats.py] */
|
/* CQC rank. [stats.py] */
|
||||||
"Amateur" = "Аматор";
|
"Amateur" = "Аматор";
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user