Commit 9b416f25 authored by Ivica Bukvic's avatar Ivica Bukvic
Browse files

cosmetic improvements to the preferences dialog

parent 236797e6
......@@ -93,7 +93,7 @@ proc ::dialog_gui::set_gui_preset {args} {
set ::pd_colors(magic_glass_text) "#000000"
set ::pd_colors(magic_glass_flash) "#e87216"
}
L2ork {
L2Ork {
set ::pd_colors(atom_box) "#eee"
set ::pd_colors(atom_box_border) "#ccc"
set ::pd_colors(canvas_color) white
......@@ -124,7 +124,7 @@ proc ::dialog_gui::set_gui_preset {args} {
set ::pd_colors(magic_glass_text) white
set ::pd_colors(magic_glass_flash) "#e87216"
}
L2ork_Inverted {
L2Ork_Inverted {
set ::pd_colors(atom_box) black
set ::pd_colors(atom_box_border) white
set ::pd_colors(canvas_color) black
......@@ -289,9 +289,9 @@ proc ::dialog_gui::create_gui_dialog {mytoplevel} {
set fr [ttk::frame $mytoplevel.colors]
set p [ttk::frame $fr.presets]
ttk::label $p.presetlabel -text "Color Preset"
# ttk::combobox $fr.presets -state readonly -values {Inverted L2ork Foo}
# ttk::combobox $fr.presets -state readonly -values {Inverted L2Ork Foo}
# todo: set presets in _one_ place
::dialog_prefs::dropdown $p.presets ::gui_preset {Vanilla Inverted L2ork L2ork_Inverted Extended C64 Strongbad Subdued}
::dialog_prefs::dropdown $p.presets ::gui_preset {Vanilla Inverted L2Ork L2Ork_Inverted Extended C64 Strongbad Subdued}
pack $fr -side top
grid $p -column 0 -columnspan 3 -row 0 -sticky w -pady 21
pack $p.presetlabel -side left -padx 7
......
......@@ -305,10 +305,10 @@ proc ::dialog_midi::pdtk_alsa_midi_dialog {id indev1 indev2 indev3 indev4 \
}
grid rowconfigure $devfr all -pad 3
} else {
label $devfr.l1 -text [_ "In Ports:"]
ttk::label $devfr.l1 -text [_ "In Ports:"]
entry $devfr.x1 -textvariable midi_alsain -width 4
pack $devfr.l1 $devfr.x1 -side left
label $devfr.l2 -text [_ "Out Ports:"]
ttk::label $devfr.l2 -text [_ "Out Ports:"]
entry $devfr.x2 -textvariable midi_alsaout -width 4
pack $devfr.l2 $devfr.x2 -side left
}
......
......@@ -68,6 +68,9 @@ proc ::dialog_prefs::open_prefs_dialog {mytoplevel} {
if {[winfo exists .prefs]} {
wm deiconify .prefs
raise .prefs
# obtain last known mouse coords and pop the menu there
global pointer_x_global pointer_y_global
wm geometry .prefs "+$pointer_x_global+$pointer_y_global"
} else {
create_dialog $mytoplevel
}
......@@ -285,7 +288,7 @@ proc ::dialog_prefs::swatchbutton {name variable} {
}
# Tk's color chooser for x11 isn't very good. So instead, the user
# gets a matrix of predefined colors to choose from. If a few custom
# colors could be added (or maybe triggering Ivica's L2ork color
# colors could be added (or maybe triggering Ivica's L2Ork color
# chooser) this would be improved.
ttk::menubutton $name -menu $name.m -style PrefsColors.TMenubutton
menu $name.m
......@@ -360,12 +363,21 @@ proc ::dialog_prefs::dialog_bindings {mytoplevel dialogname} {
}
proc ::dialog_prefs::create_dialog {mytoplevel} {
toplevel .prefs -class DialogWindow
toplevel .prefs -class [winfo class .]
wm title .prefs [_ "Pure Data Preferences"]
# wm geometry .prefs =475x125+150+150
wm group .prefs .
wm resizable .prefs 0 0
wm transient .prefs
# obtain last known mouse coords and pop the menu there
global pointer_x_global pointer_y_global
if {$pointer_x_global == 0 && $pointer_y_global == 0} {
set pointer_x_global [expr [winfo rootx .]+30]
set pointer_y_global [expr [winfo rooty .]+30]
}
wm geometry .prefs "+$pointer_x_global+$pointer_y_global"
# .prefs configure -menu $::dialog_menubar
# todo: check this on the mac and on windows
......
......@@ -570,7 +570,7 @@ trace add variable gui_preset write "::dialog_gui::set_gui_preset"
# Now that we've got a trace for the colors, we can set a
# color scheme (defined in dialog_gui.tcl)
set gui_preset L2ork
set gui_preset L2Ork
# todo: find a home for these:
set ::pd_colors(signal_cord_width) 3
......@@ -4798,6 +4798,7 @@ proc pdtk_canvas_motion {name x y mods} {
set pointer_y_local $y
set pointer_x_global [expr $pointer_x_local + [winfo rootx $name]]
set pointer_y_global [expr $pointer_y_local + [winfo rooty $name]]
#puts stderr "motion $pointer_x_global $pointer_y_global"
set scroll_name [string trimright $name .c]
if { $::hit_scrollbar($scroll_name) != 0 } { set mods -1 }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment