Добавлен выбор расположения боковой панели, меню для этого и опции в конфиге.
This commit is contained in:
@@ -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
|
||||
|
@@ -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"}
|
||||
|
33
lib/gui.tcl
33
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 <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"} {
|
||||
.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)
|
||||
|
||||
|
@@ -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
|
||||
}
|
||||
|
||||
|
@@ -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" "Было заменено"
|
||||
|
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user