summaryrefslogtreecommitdiffstats
path: root/ds9
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2020-04-21 18:46:24 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2020-04-21 18:46:24 (GMT)
commitcc31711e93dcbf14a01ce650db16969c77ce751e (patch)
treedfc1ce9b8636fb74f1aca116e44746dfb16e267b /ds9
parent204656c4f45b36a5f1899332126d406be12b4a09 (diff)
downloadblt-cc31711e93dcbf14a01ce650db16969c77ce751e.zip
blt-cc31711e93dcbf14a01ce650db16969c77ce751e.tar.gz
blt-cc31711e93dcbf14a01ce650db16969c77ce751e.tar.bz2
support linux theme
Diffstat (limited to 'ds9')
-rw-r--r--ds9/library/ds9.tcl21
-rw-r--r--ds9/library/menu.tcl6
-rw-r--r--ds9/library/util.tcl4
3 files changed, 18 insertions, 13 deletions
diff --git a/ds9/library/ds9.tcl b/ds9/library/ds9.tcl
index 81d9b69..f144eb6 100644
--- a/ds9/library/ds9.tcl
+++ b/ds9/library/ds9.tcl
@@ -219,19 +219,15 @@ switch $ds9(wm) {
# themes
package require ttk::theme::aquativo
package require ttk::theme::black
- # no menu bg
- # package require ttk::theme::blue
+ package require ttk::theme::blue
package require ttk::theme::clearlooks
- # no menu bg
- # package require ttk::theme::elegance
+ package require ttk::theme::elegance
# ugly
#package require ttk::theme::itft1
- # no menu bg
- # package require ttk::theme::keramik
+ package require ttk::theme::keramik
# ugly
#package require ttk::theme::kroc
- # no menu bg
- # package require ttk::theme::plastik
+ package require ttk::theme::plastik
package require ttk::theme::radiance
# ugly
#package require ttk::theme::smog
@@ -255,11 +251,12 @@ switch $ds9(wm) {
ttk::style configure TEntry -padding 1
ttk::style configure TLabel -borderwidth 2 -padding 1
}
- ttk::style theme use default
# fix ::tk::dialog::file
set ::tk::dialog::file::showHiddenVar 0
set ::tk::dialog::file::showHiddenBtn 1
+
+ ttk::style theme use default
}
aqua {
set ds9(foreground) systemTextColor
@@ -503,9 +500,6 @@ ProcessCommandLineFirst
# Load any preferences here, before we do any real work
if {$ds9(prefs)} {
LoadPrefs
-
- # theme may have changed
- PrefsTheme
}
# set fonts
@@ -652,6 +646,9 @@ switch $ds9(wm) {
update
wm geometry $ds9(top) \
"[winfo width $ds9(top)]x[winfo height $ds9(top)]"
+
+ # be sure theme has been set
+ PrefsTheme
}
aqua {}
win32 {
diff --git a/ds9/library/menu.tcl b/ds9/library/menu.tcl
index f25ddfd..6c65e63 100644
--- a/ds9/library/menu.tcl
+++ b/ds9/library/menu.tcl
@@ -47,6 +47,12 @@ proc CreateMenuBar {} {
proc ThemeChangedMenu {which} {
$which configure -bg [ttk::style lookup TMenubutton -background]
$which configure -fg [ttk::style lookup TMenubutton -foreground]
+ if {0} {
+ $which configure -activebackground \
+ [ttk::style lookup TMenubutton -selectbackground]
+ $which configure -activeforeground \
+ [ttk::style lookup TMenubutton -selectforeground]
+ }
}
proc AppleMenu {mb} {
diff --git a/ds9/library/util.tcl b/ds9/library/util.tcl
index f57c0c4..7732321 100644
--- a/ds9/library/util.tcl
+++ b/ds9/library/util.tcl
@@ -1741,7 +1741,9 @@ proc ProcessThemeCmd {varname iname} {
upvar $varname var
upvar $iname i
- ttk::style theme use [lindex $var $i]
+ global pds9
+ set pds9(theme) [lindex $var $i]
+ PrefsTheme
}
# backward compatibility