Добавлен выбор расположения боковой панели, меню для этого и опции в конфиге.

This commit is contained in:
svkalinin 2022-08-17 16:52:22 +03:00
parent bd3d5bb4b5
commit 031cf564cf
9 changed files with 83 additions and 39 deletions

View File

@ -67,3 +67,9 @@
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)

View File

@ -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

View File

@ -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"}

View File

@ -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 <Button-1> "NB::CloseTab %W %x %y\;[bind TNotebook <Button-1>]"
# bind $frm_tree.tree <ButtonRelease> "TreePress $frm_tree.tree"
#.panel add $frmTool -weight 1
if {$cfgVariables(toolBarShow) eq "true"} {
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)

View File

@ -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
}

View File

@ -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" "Было заменено"

View File

@ -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 {
switch $cfgVariables(filesPanelPlace) {
"left" {
.frmBody.panel insert 0 .frmBody.frmTree
set cfgVariables(toolBarShow) true
}
"right" {
.frmBody.panel add .frmBody.frmTree
}
default {
.frmBody.panel insert 0 .frmBody.frmTree
}
}
set cfgVariables(filesPanelShow) true
}
}

View File

@ -10,7 +10,7 @@ exec wish "$0" -- "$@"
######################################################
# Version: 2.0.0
# Release: alpha
# Build: 16082022151910
# Build: 17082022162534
######################################################
# определим текущую версию, релиз и т.д.

View File

@ -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 \
@ -72,6 +71,7 @@ namespace eval ttk::theme::dark {
-fieldbackground $colors(-lightframe) \
-foreground #ffffff \
-padding {2 0}
ttk::style configure TSpinbox \
-fieldbackground $colors(-lightframe) \
-foreground #ffffff
@ -91,6 +91,9 @@ namespace eval ttk::theme::dark {
-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)]\