Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions WtProgram/GroupPlugins/MouseScrollPlugin.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ open System.Runtime.InteropServices
type MouseScrollPlugin() as this =

member this.wtGroup = Services.get<WindowGroup>()
member this.settings = Services.get<ISettings>()

member this.onMouseLL(msg, pt, data:IntPtr) =
match msg with
| WindowMessages.WM_MOUSEWHEEL ->
let wheelDelta = data.hiword
let doSwitch =
if Win32Helper.IsKeyPressed(VirtualKeyCodes.VK_SHIFT) then
let enableShiftScroll = this.settings.getValue("enableShiftScroll") :?> bool
let doSwitch =
if enableShiftScroll && Win32Helper.IsKeyPressed(VirtualKeyCodes.VK_SHIFT) then
this.wtGroup.isPointInGroup(pt)
else
this.wtGroup.isPointInTs(pt)
Expand All @@ -23,4 +25,4 @@ type MouseScrollPlugin() as this =

interface IPlugin with
member x.init() =
this.wtGroup.mouseLL.Add this.onMouseLL
this.wtGroup.mouseLL.Add this.onMouseLL
4 changes: 2 additions & 2 deletions WtProgram/ManagerViewService/Views/BehaviorView.fs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Bemo
namespace Bemo
open System
open System.Drawing
open System.IO
Expand Down Expand Up @@ -97,6 +97,7 @@ type HotKeyView() =
let fields = fields.prependList(List2([
("enableCtrlNumberHotKey", settingsCheckbox "enableCtrlNumberHotKey")
("enableHoverActivate", settingsCheckbox "enableHoverActivate")
("enableShiftScroll", settingsCheckbox "enableShiftScroll")
]))

"Switch Tabs", UIHelper.form fields
Expand Down Expand Up @@ -127,4 +128,3 @@ type HotKeyView() =
member x.key = SettingsViewType.HotKeySettings
member x.title = resources.GetString("Behavior")
member x.control = table :> Control

3 changes: 3 additions & 0 deletions WtProgram/Properties/Resources.ja-JP.resx
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@
<data name="enableHoverActivate" xml:space="preserve">
<value>マウスホバーでタブを有効にする</value>
</data>
<data name="enableShiftScroll" xml:space="preserve">
<value>タブ切り替えに Shift+スクロール を使用可能にする</value>
</data>
<data name="autoHide" xml:space="preserve">
<value>最大化時にタブを自動的に隠す</value>
</data>
Expand Down
3 changes: 3 additions & 0 deletions WtProgram/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@
<data name="enableHoverActivate" xml:space="preserve">
<value>Enable mouse hover to activate tab</value>
</data>
<data name="enableShiftScroll" xml:space="preserve">
<value>Enable Shift+Scroll to switch tabs</value>
</data>
<data name="autoHide" xml:space="preserve">
<value>Auto hide tab when maximized</value>
</data>
Expand Down
2 changes: 2 additions & 0 deletions WtProgram/Settings.fs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ type Settings(isStandAlone) as this =
enableCtrlNumberHotKey = settingsJson.getBool("enableCtrlNumberHotKey").def(true)
enableHoverActivate = settingsJson.getBool("enableHoverActivate").def(false)
autoHide = settingsJson.getBool("autoHide").def(true)
enableShiftScroll = settingsJson.getBool("enableShiftScroll").def(true)
version = settingsJson.getString("version").def(String.Empty)
alignment = settingsJson.getString("alignment").def("Center")
tabAppearance =
Expand Down Expand Up @@ -177,6 +178,7 @@ type Settings(isStandAlone) as this =
settingsJson.setBool("enableCtrlNumberHotKey", settings.enableCtrlNumberHotKey)
settingsJson.setBool("enableHoverActivate", settings.enableHoverActivate)
settingsJson.setBool("autoHide", settings.autoHide)
settingsJson.setBool("enableShiftScroll", settings.enableShiftScroll)
settingsJson.setStringArray("includedPaths", settings.includedPaths.items)
settingsJson.setStringArray("excludedPaths", settings.excludedPaths.items)
settingsJson.setStringArray("autoGroupingPaths", settings.autoGroupingPaths.items)
Expand Down
1 change: 1 addition & 0 deletions WtProgram/Shared/ProgramTypes.fs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ type SettingsRec = {
combineIconsInTaskbar: bool
enableHoverActivate: bool
autoHide: bool
enableShiftScroll: bool
alignment: string
}

Expand Down