Skip to content

Commit

Permalink
Merge pull request #13 from ruchuby/develop
Browse files Browse the repository at this point in the history
Starter v0.3.1
  • Loading branch information
AkiChase authored Apr 4, 2023
2 parents 9a54c20 + 6b933e0 commit e183a36
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 14 deletions.
Binary file modified resource/img/add.ico
Binary file not shown.
Binary file modified resource/img/delete.ico
Binary file not shown.
Binary file modified resource/img/edit.ico
Binary file not shown.
Binary file modified resource/img/folder.ico
Binary file not shown.
Binary file modified resource/img/info.ico
Binary file not shown.
Binary file modified resource/img/plugin.ico
Binary file not shown.
Binary file modified resource/img/reload.ico
Binary file not shown.
Binary file modified resource/img/run.ico
Binary file not shown.
4 changes: 2 additions & 2 deletions src/Gui/IntelligentEditGui.ah2
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ class IntelligentEditGui {
this.matchInfo["DDL"] := this.gui.AddDropDownList("xp+90 yp-5 w100 R5", this.curItem.match.modeKeys)
this.matchInfo["DDL"].OnEvent("Change", (*) => this.curItem.match.mode := this.curItem.match.modeKeys[this.matchInfo["DDL"].Value])

this.gui.AddPicture("xp+110 yp AltSubmit", GlobalData.imgDir "\help.png").OnEvent("Click", (*) => this.showMatchHelp())
this.gui.AddPicture("xp+110 yp-2 w32 h32 AltSubmit", GlobalData.imgDir "\help.png").OnEvent("Click", (*) => this.showMatchHelp())

this.matchInfo["box"] := this.gui.AddGroupBox("x280 y200 w442 h130")
this.matchInfo["box"].SetFont("s12")
Expand All @@ -297,7 +297,7 @@ class IntelligentEditGui {
this.gui.AddText("w80 x280 y350", "脚本模式")
this.scriptInfo["DDL"] := this.gui.AddDropDownList("xp+90 yp-5 w100 R5", this.curItem.script.modeKeys)
this.scriptInfo["DDL"].OnEvent("Change", (ddl, *) => this.curItem.script.mode := this.curItem.script.modeKeys[ddl.Value])
this.gui.AddPicture("xp+110 yp AltSubmit", GlobalData.imgDir "\help.png").OnEvent("Click", (*) => this.showScripHelp())
this.gui.AddPicture("xp+110 yp-2 w32 h32 AltSubmit", GlobalData.imgDir "\help.png").OnEvent("Click", (*) => this.showScripHelp())

this.scriptInfo["programText"] := this.gui.AddText("w80 x280 y390", "程序路径")
this.scriptInfo["programEdit"] := this.gui.AddEdit("w350 yp-5 xp+90")
Expand Down
8 changes: 6 additions & 2 deletions src/Gui/SearchGui/IntelligentMode.ah2
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ class IntelligentMode {
; 鼠标双击运行
this.listView.OnEvent("DoubleClick", (_lv, rowNum) => this.intelligentRun(rowNum))
; 菜单栏
this.listView.OnEvent("ContextMenu", (_lv, rowNum, *) => rowNum ? this.menu.Show() : 0)
this.listView.OnEvent("ContextMenu", (_lv, rowNum, *) => !rowNum ?
0 : rowNum > this.pluginSearchResult.Length ?
this.menu.Show() : this.pluginSearchResult[rowNum].HasOwnProp("menu") ?
this.pluginSearchResult[rowNum].menu.Show() : 0
)

; 启动模式热键处理函数
this.hotkeyHandlerMap["~Esc"] := () => StrLen(SearchGui.edit.Value) ? SearchGui.searchText := SearchGui.edit.Value := "" : this.hideGui()
Expand All @@ -62,7 +66,7 @@ class IntelligentMode {
static menuInit() {
this.menu := Menu()
this.menu.Add("执行选中项`t(&R)", (*) => this.intelligentRun(this.focusedRow))
this.menu.Add("编辑选中项`t(&E)", (*) => this.toIntelligentEditGui(this.focusedRow))
this.menu.Add("编辑选中项`t(&E)", (*) => this.toIntelligentEditGui(this.startupFocusedRow))

this.menu.SetIcon("1&", GlobalData.imgDir "\run.ico")
this.menu.SetIcon("2&", GlobalData.imgDir "\edit.ico")
Expand Down
10 changes: 8 additions & 2 deletions src/Gui/SearchGui/SearchGui.ah2
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,19 @@ class SearchGui {
}
;#endregion

;#region 设置搜索模式 0: 启动模式, 1: 智能模式 ,-1: 插件模式
;#region 设置搜索模式 -1: 插件模式,0: 启动模式, 1: 智能模式
static _mode := -2
static mode {
get => this._mode
set {
if (this._mode == value) ; 不需要切换时直接返回
if (this._mode == value) { ; 不需要切换时,强制激活指定的autoHide
l := [PluginMode, StartupMode, IntelligentMode]
curModeC := l[Value + 2], l.RemoveAt(Value + 2)
curModeC.autoHideFlag := true
for c in l
c.autoHideFlag := false
return
}
this._mode := value
if (this._mode == 1) { ; IntelligentMode
this.thumb.Value := "hBitmap:*" this.thumbList[2]
Expand Down
4 changes: 2 additions & 2 deletions src/Gui/SearchGui/StartupMode.ah2
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ class StartupMode {
this.menu := Menu()
this.menu.Add("启动选中项`t(&R)", (*) => this.startSelectedFile(this.focusedRow))
this.menu.Add("文件夹中打开`t(&O)", (*) => this.openSelectedFileInFolder(this.focusedRow))
this.menu.Add("编辑选中项`t(&E)", (*) => this.toStartupEditGui(this.focusedRow))
this.menu.Add("删除选中项`t(&X)", (*) => this.deleteItem(this.focusedRow))
this.menu.Add("编辑选中项`t(&E)", (*) => this.toStartupEditGui(this.startupFocusedRow))
this.menu.Add("删除选中项`t(&X)", (*) => this.deleteItem(this.startupFocusedRow))

this.menu.SetIcon("1&", GlobalData.imgDir "\run.ico")
this.menu.SetIcon("2&", GlobalData.imgDir "\folder.ico")
Expand Down
8 changes: 2 additions & 6 deletions src/Starter.ah2
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,5 @@ PluginHelper.init() ;同时执行所有插件的入口函数
if (!IsSet(DEBUG) || !DEBUG)
OnExit((*) => GlobalData.onExitHandler()) ;退出时保存数据

;@Ahk2Exe-IgnoreBegin
^!q:: {
Send("^s")
Reload()
}
;@Ahk2Exe-IgnoreEnd
if (IsSet(DEBUG) && DEBUG)
Hotkey("^!q", (*) => (Send("^s"), Reload()))

0 comments on commit e183a36

Please sign in to comment.