From 014628276ebf13f5175bf4293460c2c82611d916 Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Thu, 23 Apr 2020 19:36:54 +0200 Subject: [PATCH] fix #30 - Show a dialog when there's an attempt to close a docked widget but that docking is locked --- CHANGELOG.md | 3 ++- src/u_widget.lfm | 1 - src/u_widget.pas | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 25e26005..0819aba8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Enhancements - Dlang highlighter: added suport for HEREDOC strings literal of type `q"()"` `q"[]"`, `q"<>"` and `q"{}"`. "Custom" HEREDOC strings literal wont be handled as they might be removed as per DIP 1026. +- Docking: added disalog to remind that docking is locked in certain scenarios. (#30) - TODO list: a new option, _disableIfMoreFilesThan_, allows to disable auto refreshing of the list could be slow when the current project is huge. ## Bugs fixed @@ -14,7 +15,7 @@ ## Other - Toolchain: removed the background tool _dastworx_ and replaced it with a library called _libdexed-d_. -- Toolchain: ddemangle is not required anymore and is moved to _libdexed-d_. +- Toolchain: ddemangle is not required anymore, demangling D names is nopw done in _libdexed-d_. # v3.8.4 diff --git a/src/u_widget.lfm b/src/u_widget.lfm index ee92818c..9220c13c 100644 --- a/src/u_widget.lfm +++ b/src/u_widget.lfm @@ -9,7 +9,6 @@ object DexedWidget: TDexedWidget ClientWidth = 332 ShowHint = True ShowInTaskBar = stNever - LCLVersion = '2.0.0.4' object Back: TPanel Left = 0 Height = 121 diff --git a/src/u_widget.pas b/src/u_widget.pas index df014638..b56c6de3 100644 --- a/src/u_widget.pas +++ b/src/u_widget.pas @@ -6,7 +6,7 @@ interface uses Classes, SysUtils, FileUtil, Forms, Controls, ExtCtrls, ActnList, Menus, - AnchorDocking, u_interfaces, u_dsgncontrols, u_common; + AnchorDocking, u_interfaces, u_dsgncontrols, u_common, u_dialogs; type @@ -188,7 +188,9 @@ begin result := inherited; if fIsDockable and (not DockMaster.AllowDragging) and not (DockMaster.GetAnchorSite(self).GetTopParent = DockMaster.GetAnchorSite(self)) then - result := false; + begin + result := dlgYesNo('widgets are currently locked, close anyway ?') = mrYes; + end; end; function TDexedWidget.getIfModal: boolean;