mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 14:07:46 +08:00
3.4 KiB
3.4 KiB
Panel Binding Feature
Overview
This feature allows users to bind the Connections and Config panels together when they are in auto-hide state (collapsed). When one panel is clicked to expand, the other panel will automatically expand as well.
How It Works
User Workflow
- The user collapses both the Connections and Config panels by clicking the auto-hide pin icon (they become auto-hidden tabs on the left side)
- The user enables the "Bind Connections and Config panels together when auto-hidden" option in Tools > Options > Tabs & Panels
- When the user clicks on the Connections tab to expand it, the Config panel will automatically expand as well
- Similarly, when clicking on the Config tab, the Connections panel will expand
- Both panels stay expanded together, allowing the user to view connection settings easily
- When the user clicks away from the panels, both collapse back to auto-hide
Benefits
- Reduces the number of clicks needed to view and edit connection settings
- Panels work together seamlessly when in auto-hide mode
- User can still use panels independently when they are pinned (docked)
- Configurable option allows users to enable/disable as needed
Implementation Details
Files Modified
- Properties/OptionsTabsPanelsPage.settings - Added
BindConnectionsAndConfigPanelssetting (default: false) - Properties/OptionsTabsPanelsPage.Designer.cs - Added property accessor for the new setting
- UI/Panels/PanelBinder.cs - NEW - Core logic for binding panel visibility
- UI/Forms/OptionsPages/TabsPanelsPage.cs - Added checkbox and load/save logic
- UI/Forms/OptionsPages/TabsPanelsPage.Designer.cs - Added UI checkbox control
- UI/Forms/frmMain.cs - Initialize PanelBinder after panels are loaded
- Config/Settings/Registry/OptRegistryTabsPanelsPage.cs - Added registry support for enterprise deployment
Key Classes
PanelBinder
- Singleton class that manages the binding between panels
- Subscribes to VisibleChanged events on both TreeForm (Connections) and ConfigForm (Config)
- Only acts when:
- The binding setting is enabled
- Both panels are in auto-hide state
- One panel becomes visible (user clicked its tab)
- Uses a
_isProcessingflag to prevent recursive event triggers - Calls
Activate()on the other panel to show it
How to Test
- Build and run mRemoteNG
- Go to Tools > Options > Tabs & Panels
- Verify the new checkbox "Bind Connections and Config panels together when auto-hidden" is present
- Create a test connection in the Connections panel
- Auto-hide both the Connections and Config panels (click the pin icon on each)
- Both panels should now appear as collapsed tabs on the left side
- Enable the binding option in Options
- Click on the Connections tab - both Connections and Config should expand
- Click away from the panels - both should collapse
- Click on the Config tab - both panels should expand again
- Disable the binding option
- Verify panels now work independently when clicking their tabs
- Pin one or both panels (dock them)
- Verify the binding only works when BOTH panels are in auto-hide state
Registry Support
Administrators can configure this setting via registry for enterprise deployment:
- Key:
HKEY_LOCAL_MACHINE\SOFTWARE\mRemoteNG\TabsAndPanelsorHKEY_CURRENT_USER\SOFTWARE\mRemoteNG\TabsAndPanels - Value:
BindConnectionsAndConfigPanels(DWORD) - 0 = Disabled, 1 = Enabled