From d9d071092e4f1936615166a160c528bb934eac99 Mon Sep 17 00:00:00 2001 From: svkalinin Date: Thu, 15 Sep 2022 12:35:05 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=20=D0=B2=20=D0=B4=D0=B8=D0=B0=D0=BB=D0=BE=D0=B3?= =?UTF-8?q?=D0=B5=20=D0=BF=D0=BE=D0=B8=D1=81=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TODO | 5 ----- lib/editor.tcl | 24 ++++++++++++++++-------- lib/msgs/ru.msg | 1 + theme/ttk_theme_dark.tcl | 16 ++++++++-------- 4 files changed, 25 insertions(+), 21 deletions(-) diff --git a/TODO b/TODO index 0d393a2..ff29380 100644 --- a/TODO +++ b/TODO @@ -9,8 +9,6 @@ --- Ansible --- 1. Определение всех переменных в отдельный список - - если открыт каталог с плэйбуками - подкаталоги vars, group_vars, host_vars, файл inventory - внутри файла, конструкции вида: set_fact: varName: value @@ -22,7 +20,4 @@ - var1.yml - var2.yml -2. Внутри редактора на переменных {{ var_name }} сделать либо по наведении мыши либо по щелчку, - либо добавить ссылку на файл и где эта переменная определена - 3. Если используется роль и переменная не найдена в плэйбуке то искать в роли (не факт что требуется) diff --git a/lib/editor.tcl b/lib/editor.tcl index a2eda3e..b3c4a77 100644 --- a/lib/editor.tcl +++ b/lib/editor.tcl @@ -838,6 +838,7 @@ namespace eval Editor { } wm geom $win +$x+$y } + proc FindReplaceText {findString replaceString regexp} { global nbEditor set txt [$nbEditor select].frmText.t @@ -884,11 +885,15 @@ namespace eval Editor { $txt tag add sel $ind $endInd incr i } + .finddialog.lblCounter configure -text "[::msgcat::mc "Finded"]: $i" + # set pos [$txt search $options $findString $pos end] # $txt mark set insert $pos - $txt see $pos + if {[lindex $lstFindIndex 0] ne "" } { + $txt see [lindex $lstFindIndex 0] + } # puts $pos # # highlight the found word # set line [lindex [split $pos "."] 0] @@ -917,7 +922,7 @@ namespace eval Editor { set txt $w.frmText.t set win .finddialog set regexpSet "" - # set nocaseSet "-nocase" + set searchAll "-all" if { [winfo exists $win] } { destroy $win } toplevel $win @@ -944,7 +949,7 @@ namespace eval Editor { -command { puts $Editor::show($Editor::win.entryReplace) if {$Editor::show($Editor::win.entryReplace) eq "false"} { - grid $Editor::win.entryReplace -row 1 -column 0 -columnspan 2 -sticky nsew + grid $Editor::win.entryReplace -row 1 -column 0 -columnspan 3 -sticky nsew grid $Editor::win.bDone -row 1 -column 3 -sticky e grid $Editor::win.bDoneAll -row 1 -column 4 -sticky e set Editor::show($Editor::win.entryReplace) "true" @@ -955,15 +960,17 @@ namespace eval Editor { } ttk::checkbutton $win.chkRegexp -text "Regexp" \ -variable regexpSet -onvalue "-regexp" -offvalue "" - # ttk::checkbutton $win.chkCase -text "Case Sensitive" \ - # -variable nocaseSet -onvalue "" -offvalue "-nocase" - - grid $win.entryFind -row 0 -column 0 -columnspan 2 -sticky nsew + ttk::checkbutton $win.chkAll -text "All" -state disable\ + -variable searchAll -onvalue "-all" -offvalue "" + ttk::label $win.lblCounter -justify right -anchor e -text "" + + grid $win.entryFind -row 0 -column 0 -columnspan 3 -sticky nsew grid $win.bForward -row 0 -column 3 -sticky e grid $win.bBackward -row 0 -column 4 -sticky e grid $win.bReplace -row 0 -column 5 -sticky e grid $win.chkRegexp -row 2 -column 0 -sticky w - # grid $win.chkCase -row 2 -column 1 -sticky w + # grid $win.chkAll -row 2 -column 1 -sticky w + grid $win.lblCounter -row 2 -column 2 -sticky we # set reqWidth [winfo reqwidth $win] set boxX [expr [winfo rootx $w] + [expr [winfo width $nbEditor] - 350]] @@ -998,6 +1005,7 @@ namespace eval Editor { if [winfo exists $w.frmText2] { $w.panelTxt forget $w.frmText2 destroy $w.frmText2 + focus -force $w.frmText.t.t return } set frmText [Editor::EditorWidget $w $fileType] diff --git a/lib/msgs/ru.msg b/lib/msgs/ru.msg index 6ecf0df..665fd56 100644 --- a/lib/msgs/ru.msg +++ b/lib/msgs/ru.msg @@ -77,6 +77,7 @@ ::msgcat::mcset ru "File modify" "Файл изменен" ::msgcat::mcset ru "File saved" "Файл сохранен" ::msgcat::mcset ru "Find" "Найти" +::msgcat::mcset ru "Finded" "Найдено" ::msgcat::mcset ru "Find in files" "Найти в файлах" ::msgcat::mcset ru "Font normal" "Нормальный шрифт" ::msgcat::mcset ru "Font bold" "Жирный шрифт" diff --git a/theme/ttk_theme_dark.tcl b/theme/ttk_theme_dark.tcl index 19557a4..0db0db6 100644 --- a/theme/ttk_theme_dark.tcl +++ b/theme/ttk_theme_dark.tcl @@ -60,15 +60,17 @@ namespace eval ttk::theme::dark { # ttk widgets. ttk::style configure TButton \ - -width -8 -padding {5 1} -relief link + -width -8 -padding {5 1} -relief link ttk::style configure TMenubutton -relief flat -arrowsize 0 ttk::style configure TCheckbutton \ - -indicatorbackground "#ffffff" -indicatormargin {1 1 4 1} + -indicatorbackground $colors(-lighter) -indicatormargin {1 1 4 1} ttk::style configure TRadiobutton \ - -indicatorbackground "#ffffff" -indicatormargin {1 1 4 1} + -indicatorbackground "#ffffff" -indicatormargin {1 1 4 1} ttk::style configure TFrame -relief flat -border -1 - # ttk::style configure TEntry -fieldbackground #ffffff -foreground #000000 -padding {2 0} - ttk::style configure TEntry -fieldbackground $colors(-lightframe) -foreground #ffffff -padding {2 0} + ttk::style configure TEntry -fieldbackground $colors(-lightframe) \ + -padding {2 0} + ttk::style configure TLabel -foreground $colors(-disabledfg) \ + -background $colors(-frame) -padding {2 0} ttk::style configure TCombobox \ -fieldbackground $colors(-lightframe) \ @@ -105,9 +107,7 @@ namespace eval ttk::theme::dark { -linemapfg [list active $colors(-linemapfg)]\ -background [list active $colors(-lighter)] \ -foreground [list disabled $colors(-disabledfg)] - - ttk::style configure TLabel -foreground $colors(-disabledfg) -padding {2 0} - + # ttk::style configure TreeCtrl \ # -background gray30 -itembackground {gray60 gray50} \ # -itemfill #ffffff -itemaccentfill yellow