From 0c655981565c951f2e7b2b237c26cd177d8da83d Mon Sep 17 00:00:00 2001 From: Luxferre Date: Sat, 12 Oct 2024 19:09:06 +0300 Subject: [PATCH] v0.6: compacted UI --- armagedec.tcl | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/armagedec.tcl b/armagedec.tcl index 01c91a3..7730869 100755 --- a/armagedec.tcl +++ b/armagedec.tcl @@ -591,7 +591,7 @@ foreach opt $wa_opts { ttk::entry $txtid -width 8 -textvariable $boundvar pack $lblid -side left -fill x -padx 5 pack $txtid -side right - grid $elpref -column $col -row $row -sticky nwe + grid $elpref -column $col -row $row -sticky nwe -pady 5 } elseif {([lindex $valopt 0] eq "bool")} { # create a checkbox entry set chkid ".tabbar.nopts.opts.chk$offs" ttk::checkbutton $chkid -text $name -variable $boundvar -onvalue 1 -offvalue 0 @@ -634,25 +634,25 @@ foreach weap $wa_weapons { set boundvar_prob "wsc_data($proboffs)" set groupid ".tabbar.weap.$offs" ttk::labelframe $groupid -text $wname -labelanchor nw - ttk::label "$groupid.ammolbl" -text "Ammo" + ttk::label "$groupid.ammolbl" -text "A" ttk::entry "$groupid.ammotxt" -textvariable $boundvar_ammo -width 4 grid "$groupid.ammolbl" -column 0 -row 0 -sticky nsw grid "$groupid.ammotxt" -column 1 -row 0 -sticky nw - ttk::label "$groupid.powerlbl" -text "Power" + ttk::label "$groupid.powerlbl" -text "P" ttk::entry "$groupid.powertxt" -textvariable $boundvar_power -width 4 - grid "$groupid.powerlbl" -column 0 -row 1 -sticky nsw - grid "$groupid.powertxt" -column 1 -row 1 -sticky nw - ttk::label "$groupid.delaylbl" -text "Delay" + grid "$groupid.powerlbl" -column 2 -row 0 -sticky nsw + grid "$groupid.powertxt" -column 3 -row 0 -sticky nw + ttk::label "$groupid.delaylbl" -text "D" ttk::entry "$groupid.delaytxt" -textvariable $boundvar_delay -width 4 - grid "$groupid.delaylbl" -column 0 -row 2 -sticky nsw - grid "$groupid.delaytxt" -column 1 -row 2 -sticky nw - ttk::label "$groupid.problbl" -text "Probability" + grid "$groupid.delaylbl" -column 4 -row 0 -sticky nsw + grid "$groupid.delaytxt" -column 5 -row 0 -sticky nw + ttk::label "$groupid.problbl" -text "Pr" ttk::entry "$groupid.probtxt" -textvariable $boundvar_prob -width 4 - grid "$groupid.problbl" -column 0 -row 3 -sticky nsw - grid "$groupid.probtxt" -column 1 -row 3 -sticky nw + grid "$groupid.problbl" -column 6 -row 0 -sticky nsw + grid "$groupid.probtxt" -column 7 -row 0 -sticky nw grid $groupid -column $col -row $row -sticky news -padx 5 -pady 3 incr col - if {$col > 10} { + if {$col > 4} { set col 0 incr row } @@ -662,15 +662,14 @@ foreach weap $wa_weapons { ttk::frame .tabbar.extopts .tabbar add .tabbar.extopts -text "Extended options (v3)" -# Extended option checkboxes in the first tab -set eflpref ".tabbar.nopts.eflags" -ttk::labelframe $eflpref -text "Extended option flags (v3)" -grid $eflpref -row 1 -column 0 -sticky nw -padx 5 -pady 5 -columnspan 8 +# Second extended options tabframe +ttk::frame .tabbar.extflags +.tabbar add .tabbar.extflags -text "Extended option flags (v3)" # Extended option textboxes in the first tab set etpref ".tabbar.nopts.etxts" ttk::labelframe $etpref -text "Extended option parameters (v3)" -grid $etpref -row 2 -column 0 -sticky nw -padx 5 -pady 5 -columnspan 8 +grid $etpref -row 2 -column 0 -sticky nw -padx 5 -pady 5 -columnspan 5 set row 0 set col 0 @@ -694,18 +693,18 @@ foreach opt $wa_ext_opts { ttk::entry $txtid -width 8 -textvariable $boundvar pack $lblid -side left -fill x -padx 5 pack $txtid -side right - grid $elpref -column $txtcol -row $txtrow -sticky nwe + grid $elpref -column $txtcol -row $txtrow -sticky nwe -pady 5 incr txtcol - if {$txtcol > 5} { + if {$txtcol > 4} { set txtcol 0 incr txtrow } } elseif {([lindex $valopt 0] eq "bool")} { # create a checkbox entry - set chkid ".tabbar.nopts.eflags.chk$offs" + set chkid ".tabbar.extflags.chk$offs" ttk::checkbutton $chkid -text $name -variable $boundvar -onvalue 1 -offvalue 0 grid $chkid -column $chkcol -row $chkrow -sticky nw incr chkcol - if {$chkcol > 4} { + if {$chkcol > 3} { set chkcol 0 incr chkrow } @@ -854,3 +853,4 @@ grid $verpref.verlbl -column 0 -row 1 -sticky nws -padx 5 -pady 5 grid $verpref.vertxt -column 1 -row 1 -sticky nw -padx 5 -pady 5 grid $verpref -column 0 -row 1 -sticky nw -padx 5 -pady 5 +