From 031cf564cffacc17be67f63c58d8a0d7b1406286 Mon Sep 17 00:00:00 2001 From: svkalinin Date: Wed, 17 Aug 2022 16:52:22 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20=D0=B2=D1=8B=D0=B1=D0=BE=D1=80=20=D1=80=D0=B0=D1=81?= =?UTF-8?q?=D0=BF=D0=BE=D0=BB=D0=BE=D0=B6=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=B1?= =?UTF-8?q?=D0=BE=D0=BA=D0=BE=D0=B2=D0=BE=D0=B9=20=D0=BF=D0=B0=D0=BD=D0=B5?= =?UTF-8?q?=D0=BB=D0=B8,=20=D0=BC=D0=B5=D0=BD=D1=8E=20=D0=B4=D0=BB=D1=8F?= =?UTF-8?q?=20=D1=8D=D1=82=D0=BE=D0=B3=D0=BE=20=D0=B8=20=D0=BE=D0=BF=D1=86?= =?UTF-8?q?=D0=B8=D0=B8=20=D0=B2=20=D0=BA=D0=BE=D0=BD=D1=84=D0=B8=D0=B3?= =?UTF-8?q?=D0=B5.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG | 6 ++++++ lib/config.tcl | 6 ++++-- lib/editor.tcl | 4 ++-- lib/gui.tcl | 33 +++++++++++++++++++++++---------- lib/menu.tcl | 9 ++++++++- lib/msgs/ru.msg | 5 ++++- lib/procedure.tcl | 18 ++++++++++++++---- projman.tcl | 6 +++--- theme/ttk_theme_dark.tcl | 35 +++++++++++++++++++---------------- 9 files changed, 83 insertions(+), 39 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index a12790e..b2c7ed8 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -66,4 +66,10 @@ 16/08/2022 - Added selection of all words in the text by clicking on the any word + +17/08/2022 + - Added "Vew Panel" menu and "Panel side" (left/right) + - Changed standard Tk menu on TTK::menu + - Added config options filesPanelPlace (left/right) + - Fixed ViewFilesTree procedure with rigth variable filesPanelShow (true/false) diff --git a/lib/config.tcl b/lib/config.tcl index ee81025..14c7627 100644 --- a/lib/config.tcl +++ b/lib/config.tcl @@ -29,17 +29,19 @@ theme=dark toolBarShow=true menuShow=true filesPanelShow=true +filesPanelPlace=left geometry=1024x768 guiFont={Droid Sans Mono} 9 guiFontBold={Droid Sans Mono} 9 bold guiFG=#cccccc \[Editor\] autoFormat=true -font=courier 10 normal roman -fontBold=courier 10 bold roman +font=Monospace 10 +fontBold=Monospace 10 backGround=#333333 foreground=#cccccc selectbg=#10a410a410a4 +selectLightBg=grey nbNormal=#000000 nbModify=#ffff5d705d70 lineNumberFG=#a9a9a9 diff --git a/lib/editor.tcl b/lib/editor.tcl index 21b24e4..62cf826 100644 --- a/lib/editor.tcl +++ b/lib/editor.tcl @@ -640,8 +640,8 @@ namespace eval Editor { if {$cfgVariables(lineNumberShow) eq "false"} { $txt configure -linemap 0 } - $txt tag configure lightBracket -background #000000 -foreground #00ffff - $txt tag configure lightSelected -background #000000 -foreground #00ffff + $txt tag configure lightBracket -background $cfgVariables(selectLightBg) -foreground #00ffff + $txt tag configure lightSelected -background $cfgVariables(selectLightBg) -foreground #00ffff set fileType [string toupper [string trimleft [file extension $fileFullPath] "."]] if {$fileType eq ""} {set fileType "Unknown"} diff --git a/lib/gui.tcl b/lib/gui.tcl index ed9e6d6..bfef450 100644 --- a/lib/gui.tcl +++ b/lib/gui.tcl @@ -66,7 +66,7 @@ if [info exists cfgVariables(theme)] { ttk::style theme use $cfgVariables(theme) } -frame .frmMenu -border 1 -relief raised -highlightthickness 0 +ttk::frame .frmMenu -border 1 -relief raised frame .frmBody -border 1 -relief raised -highlightthickness 0 ttk::frame .frmStatus -border 0 -relief sunken pack .frmMenu -side top -padx 1 -fill x @@ -78,18 +78,18 @@ pack .frmStatus -side top -padx 1 -fill x #pack [label .frmMenu.lbl -text "ddd"] pack [ttk::label .frmStatus.lblPosition -justify right] -side right -menubutton .frmMenu.mnuFile -text [::msgcat::mc "File"] -menu .frmMenu.mnuFile.m +ttk::menubutton .frmMenu.mnuFile -text [::msgcat::mc "File"] -menu .frmMenu.mnuFile.m GetFileMenu [menu .frmMenu.mnuFile.m] -menubutton .frmMenu.mnuEdit -text [::msgcat::mc "Edit"] -menu .frmMenu.mnuEdit.m +ttk::menubutton .frmMenu.mnuEdit -text [::msgcat::mc "Edit"] -menu .frmMenu.mnuEdit.m GetEditMenu [menu .frmMenu.mnuEdit.m] -menubutton .frmMenu.mnuView -text [::msgcat::mc "View"] -menu .frmMenu.mnuView.m +ttk::menubutton .frmMenu.mnuView -text [::msgcat::mc "View"] -menu .frmMenu.mnuView.m GetViewMenu [menu .frmMenu.mnuView.m] pack .frmMenu.mnuFile .frmMenu.mnuEdit .frmMenu.mnuView -side left -menubutton .frmMenu.mnuHelp -text [::msgcat::mc "Help"] -menu .frmMenu.mnuHelp.m +ttk::menubutton .frmMenu.mnuHelp -text [::msgcat::mc "Help"] -menu .frmMenu.mnuHelp.m GetHelpMenu [menu .frmMenu.mnuHelp.m] pack .frmMenu.mnuHelp -side right @@ -128,9 +128,9 @@ grid $frmTree.v -row 0 -column 1 -sticky nsew grid columnconfigure $frmTree 0 -weight 1 grid rowconfigure $frmTree 0 -weight 1 -set frm_work [ttk::frame .frm_work] +set frmWork [ttk::frame .frmWork] -set nbEditor [ttk::notebook $frm_work.nbEditor] +set nbEditor [ttk::notebook $frmWork.nbEditor] #grid $nbEditor -row 0 -column 0 -sticky nsew pack $nbEditor -fill both -expand true @@ -160,11 +160,24 @@ bind TNotebook "NB::CloseTab %W %x %y\;[bind TNotebook ]" # bind $frm_tree.tree "TreePress $frm_tree.tree" #.panel add $frmTool -weight 1 -if {$cfgVariables(toolBarShow) eq "true"} { - .frmBody.panel add $frmTree -weight 0 + + +if {$cfgVariables(filesPanelShow) eq "true"} { + switch $cfgVariables(filesPanelPlace) { + "left" { + .frmBody.panel add $frmTree -weight 0 + .frmBody.panel add $frmWork -weight 1 + } + "right" { + .frmBody.panel add $frmWork -weight 1 + .frmBody.panel add $frmTree + } + } +} else { + .frmBody.panel add $frmWork -weight 1 } -.frmBody.panel add $frm_work -weight 1 ttk::style configure . \ -foreground $::cfgVariables(guiFG) \ -font $::cfgVariables(guiFont) + diff --git a/lib/menu.tcl b/lib/menu.tcl index 7dd0dbc..ddb6bf4 100644 --- a/lib/menu.tcl +++ b/lib/menu.tcl @@ -61,7 +61,14 @@ proc GetEditMenu {m} { } proc GetViewMenu {m} { - $m add command -label [::msgcat::mc "View files tree"] -command ViewFilesTree + global cfgVariables + $m add command -label [::msgcat::mc "View panel"] -command ViewFilesTree + menu $m.panelSide + $m add cascade -label [::msgcat::mc "Panel side"] -menu $m.panelSide + + $m.panelSide add radiobutton -label [::msgcat::mc "Left"] -variable cfgVariables(filesPanelPlace) -value left + $m.panelSide add radiobutton -label [::msgcat::mc "Right"] -variable cfgVariables(filesPanelPlace) -value right + $m add command -label [::msgcat::mc "View line numbers"] -command ViewLineNumbers } diff --git a/lib/msgs/ru.msg b/lib/msgs/ru.msg index fe8bebf..e811533 100644 --- a/lib/msgs/ru.msg +++ b/lib/msgs/ru.msg @@ -186,7 +186,10 @@ ::msgcat::mcset ru "Variables" "Переменные" ::msgcat::mcset ru "Version" "Версия" ::msgcat::mcset ru "View" "Вид" -::msgcat::mcset ru "View files tree" "Показывать дерево файлов" +::msgcat::mcset ru "View panel" "Показывать дополнительную панель" +::msgcat::mcset ru "Panel side" "Расположение дополнительной панели" +::msgcat::mcset ru "Left" "Слева" +::msgcat::mcset ru "Right" "Справа" ::msgcat::mcset ru "View line numbers" "Показывать номера строк" ::msgcat::mcset ru "Warning" "Внимание" ::msgcat::mcset ru "Was replacement" "Было заменено" diff --git a/lib/procedure.tcl b/lib/procedure.tcl index 231d8d8..8cfdf6c 100644 --- a/lib/procedure.tcl +++ b/lib/procedure.tcl @@ -21,12 +21,22 @@ proc Quit {} { proc ViewFilesTree {} { global cfgVariables - if {$cfgVariables(toolBarShow) eq "true"} { + if {$cfgVariables(filesPanelShow) eq "true"} { .frmBody.panel forget .frmBody.frmTree - set cfgVariables(toolBarShow) false + set cfgVariables(filesPanelShow) false } else { - .frmBody.panel insert 0 .frmBody.frmTree - set cfgVariables(toolBarShow) true + switch $cfgVariables(filesPanelPlace) { + "left" { + .frmBody.panel insert 0 .frmBody.frmTree + } + "right" { + .frmBody.panel add .frmBody.frmTree + } + default { + .frmBody.panel insert 0 .frmBody.frmTree + } + } + set cfgVariables(filesPanelShow) true } } diff --git a/projman.tcl b/projman.tcl index c39371e..b33ec0f 100755 --- a/projman.tcl +++ b/projman.tcl @@ -10,7 +10,7 @@ exec wish "$0" -- "$@" ###################################################### # Version: 2.0.0 # Release: alpha -# Build: 16082022151910 +# Build: 17082022162534 ###################################################### # определим текущую версию, релиз и т.д. @@ -64,7 +64,7 @@ if [info exists env(XDG_CONFIG_HOME)] { } if {[file exists $dir(cfg)] == 0} { - file mkdir $dir(cfg) + file mkdir $dir(cfg) } # puts "Config dir is $dir(cfg)" @@ -97,7 +97,7 @@ foreach modFile [lsort [glob -nocomplain [file join $dir(theme) *]]] { # загружаем пользовательский конфиг, если он отсутствует, то копируем дефолтный if {[file exists [file join $dir(cfg) projman.ini]] ==0} { Config::create $dir(cfg) -} +} Config::read $dir(cfg) ::msgcat::mclocale $cfgVariables(locale) diff --git a/theme/ttk_theme_dark.tcl b/theme/ttk_theme_dark.tcl index f0fcdeb..cd22ef0 100644 --- a/theme/ttk_theme_dark.tcl +++ b/theme/ttk_theme_dark.tcl @@ -58,8 +58,7 @@ namespace eval ttk::theme::dark { # ttk widgets. ttk::style configure TButton \ -width -8 -padding {5 1} -relief link - ttk::style configure TMenubutton \ - -width -11 -padding {5 1} -relief raised + ttk::style configure TMenubutton -relief flat -arrowsize 0 ttk::style configure TCheckbutton \ -indicatorbackground "#ffffff" -indicatormargin {1 1 4 1} ttk::style configure TRadiobutton \ @@ -69,12 +68,13 @@ namespace eval ttk::theme::dark { ttk::style configure TEntry -fieldbackground $colors(-lightframe) -foreground #ffffff -padding {2 0} ttk::style configure TCombobox \ - -fieldbackground $colors(-lightframe) \ - -foreground #ffffff \ - -padding {2 0} + -fieldbackground $colors(-lightframe) \ + -foreground #ffffff \ + -padding {2 0} + ttk::style configure TSpinbox \ - -fieldbackground $colors(-lightframe) \ - -foreground #ffffff + -fieldbackground $colors(-lightframe) \ + -foreground #ffffff ttk::style configure TNotebook.Tab \ -padding {6 2 6 2} @@ -88,16 +88,19 @@ namespace eval ttk::theme::dark { -foreground [list disabled $colors(-disabledfg)] ttk::style configure Treeview \ - -background $colors(-lightframe) -itembackground {gray60 gray50} \ - -itemfill #ffffff -itemaccentfill yellow \ - -fieldbackground $colors(-lightframe) - + -background $colors(-lightframe) -itembackground {gray60 gray50} \ + -itemfill #ffffff -itemaccentfill yellow \ + -fieldbackground $colors(-lightframe) + # -indicatormargins 0 \ + # -indicatorsize -1 \ + # -padding 0 + ttk::style configure Text \ - -linemapbg [list active $colors(-lightframe)]\ - -linemapbg [list active $colors(-disabledfg)]\ - -background [list active $colors(-lighter)] \ - -foreground [list disabled $colors(-disabledfg)] - + -linemapbg [list active $colors(-lightframe)]\ + -linemapbg [list active $colors(-disabledfg)]\ + -background [list active $colors(-lighter)] \ + -foreground [list disabled $colors(-disabledfg)] + ttk::style configure TLabel -foreground $colors(-disabledfg) -padding {2 0} # ttk::style configure TreeCtrl \