add menu command to restore all colors to default, deleting "colors" config file
This commit is contained in:
parent
6317b8f5b6
commit
6cf6c58841
|
|
@ -2415,6 +2415,32 @@ proc edit_vi_netlist_prop {txtlabel} {
|
||||||
return $rcode
|
return $rcode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
proc reset_colors {ask} {
|
||||||
|
global colors dark_colors light_colors dark_colorscheme USER_CONF_DIR svg_colors ps_colors
|
||||||
|
global light_colors_save dark_colors_save
|
||||||
|
|
||||||
|
if {$ask} {
|
||||||
|
set answer [tk_messageBox -message "Warning: delete 'colors' configuration file?" \
|
||||||
|
-icon warning -parent [xschem get topwindow] -type okcancel]
|
||||||
|
if {$answer ne {ok}} { return }
|
||||||
|
}
|
||||||
|
xschem set semaphore [expr {[xschem get semaphore] +1}]
|
||||||
|
set light_colors $light_colors_save
|
||||||
|
set dark_colors $dark_colors_save
|
||||||
|
if { $dark_colorscheme == 1 } {
|
||||||
|
set colors $dark_colors
|
||||||
|
} else {
|
||||||
|
set colors $light_colors
|
||||||
|
}
|
||||||
|
regsub -all {"} $light_colors {} ps_colors
|
||||||
|
regsub -all {#} $ps_colors {0x} ps_colors
|
||||||
|
regsub -all {"} $colors {} svg_colors
|
||||||
|
regsub -all {#} $svg_colors {0x} svg_colors
|
||||||
|
file delete ${USER_CONF_DIR}/colors
|
||||||
|
xschem build_colors
|
||||||
|
xschem redraw
|
||||||
|
xschem set semaphore [expr {[xschem get semaphore] -1}]
|
||||||
|
}
|
||||||
|
|
||||||
proc change_color {} {
|
proc change_color {} {
|
||||||
global colors dark_colors light_colors dark_colorscheme cadlayers USER_CONF_DIR svg_colors ps_colors
|
global colors dark_colors light_colors dark_colorscheme cadlayers USER_CONF_DIR svg_colors ps_colors
|
||||||
|
|
@ -4105,6 +4131,10 @@ proc build_widgets { {topwin {} } } {
|
||||||
$topwin.menubar.view.menu add command -label "Change current layer color" -accelerator {} -command {
|
$topwin.menubar.view.menu add command -label "Change current layer color" -accelerator {} -command {
|
||||||
change_color
|
change_color
|
||||||
}
|
}
|
||||||
|
$topwin.menubar.view.menu add command -label "Reset all colors to default" \
|
||||||
|
-accelerator {} -command {
|
||||||
|
reset_colors 1
|
||||||
|
}
|
||||||
$topwin.menubar.view.menu add checkbutton -label "No XCopyArea drawing model" -variable draw_window \
|
$topwin.menubar.view.menu add checkbutton -label "No XCopyArea drawing model" -variable draw_window \
|
||||||
-accelerator {Ctrl+$} \
|
-accelerator {Ctrl+$} \
|
||||||
-command {
|
-command {
|
||||||
|
|
@ -4200,12 +4230,13 @@ proc build_widgets { {topwin {} } } {
|
||||||
xschem redraw
|
xschem redraw
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$topwin.menubar.tools.menu add command -label "Select all connected wires/labels/pins" -accelerator {Shift-Right Butt.} \
|
$topwin.menubar.tools.menu add command -label "Select all connected wires/labels/pins" \
|
||||||
|
-accelerator {Shift-Right Butt.} \
|
||||||
-command { xschem connected_nets}
|
-command { xschem connected_nets}
|
||||||
$topwin.menubar.tools.menu add command -label "Select conn. wires, stop at junctions" -accelerator {Ctrl-Righ Butt.} \
|
$topwin.menubar.tools.menu add command -label "Select conn. wires, stop at junctions" \
|
||||||
-command { xschem connected_nets 1 }
|
-accelerator {Ctrl-Righ Butt.} -command { xschem connected_nets 1 }
|
||||||
|
$topwin.menubar.hilight.menu add command \
|
||||||
$topwin.menubar.hilight.menu add command -label {Highlight net-pin name mismatches on selected instances} \
|
-label {Highlight net-pin name mismatches on selected instances} \
|
||||||
-command "xschem net_pin_mismatch" \
|
-command "xschem net_pin_mismatch" \
|
||||||
-accelerator {Shift-X}
|
-accelerator {Shift-X}
|
||||||
$topwin.menubar.hilight.menu add command -label {Highlight duplicate instance names} \
|
$topwin.menubar.hilight.menu add command -label {Highlight duplicate instance names} \
|
||||||
|
|
@ -4218,7 +4249,8 @@ proc build_widgets { {topwin {} } } {
|
||||||
-command "xschem hilight" -accelerator K
|
-command "xschem hilight" -accelerator K
|
||||||
$topwin.menubar.hilight.menu add command -label {Send selected net/pins to Viewer} \
|
$topwin.menubar.hilight.menu add command -label {Send selected net/pins to Viewer} \
|
||||||
-command "xschem send_to_viewer" -accelerator Alt+G
|
-command "xschem send_to_viewer" -accelerator Alt+G
|
||||||
$topwin.menubar.hilight.menu add command -label {Select hilight nets / pins} -command "xschem select_hilight_net" \
|
$topwin.menubar.hilight.menu add command -label {Select hilight nets / pins} \
|
||||||
|
-command "xschem select_hilight_net" \
|
||||||
-accelerator Alt+K
|
-accelerator Alt+K
|
||||||
$topwin.menubar.hilight.menu add command -label {Un-highlight all net/pins} \
|
$topwin.menubar.hilight.menu add command -label {Un-highlight all net/pins} \
|
||||||
-command "xschem unhilight_all" -accelerator Shift+K
|
-command "xschem unhilight_all" -accelerator Shift+K
|
||||||
|
|
@ -4649,8 +4681,12 @@ regsub -all {"} $dark_colors {} svg_colors
|
||||||
regsub -all {#} $svg_colors {0x} svg_colors
|
regsub -all {#} $svg_colors {0x} svg_colors
|
||||||
regsub -all {"} $light_colors {} ps_colors
|
regsub -all {"} $light_colors {} ps_colors
|
||||||
regsub -all {#} $ps_colors {0x} ps_colors
|
regsub -all {#} $ps_colors {0x} ps_colors
|
||||||
|
|
||||||
set_missing_colors_to_black
|
set_missing_colors_to_black
|
||||||
|
# read-only vars to store defaults (so we can switch to default colors)
|
||||||
|
set dark_colors_save $dark_colors
|
||||||
|
set light_colors_save $light_colors
|
||||||
|
set ps_colors_save $ps_colors
|
||||||
|
set svg_colors_save $svg_colors
|
||||||
|
|
||||||
set_ne colors $dark_colors
|
set_ne colors $dark_colors
|
||||||
##### end set colors
|
##### end set colors
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue