mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-12 05:14:10 +02:00
Fixed popup location clipping
This commit is contained in:
parent
d635b8e67f
commit
757464db3e
12 changed files with 21 additions and 13 deletions
|
@ -20,7 +20,7 @@ namespace Beefy.widgets
|
||||||
public String mTitle ~ delete _;
|
public String mTitle ~ delete _;
|
||||||
public String mText ~ delete _;
|
public String mText ~ delete _;
|
||||||
public Image mIcon;
|
public Image mIcon;
|
||||||
public BFWindowBase.Flags mWindowFlags = .ClientSized | .TopMost | .Caption | .Border | .SysMenu | .Modal;
|
public BFWindowBase.Flags mWindowFlags = .ClientSized | .TopMost | .Caption | .Border | .SysMenu | .Modal | .PopupPosition;
|
||||||
public List<ButtonWidget> mButtons = new List<ButtonWidget>() ~ delete _;
|
public List<ButtonWidget> mButtons = new List<ButtonWidget>() ~ delete _;
|
||||||
public List<Widget> mTabWidgets = new List<Widget>() ~ delete _;
|
public List<Widget> mTabWidgets = new List<Widget>() ~ delete _;
|
||||||
public Dictionary<ButtonWidget, DialogEventHandler> mHandlers = new Dictionary<ButtonWidget, DialogEventHandler>() ~ delete _;
|
public Dictionary<ButtonWidget, DialogEventHandler> mHandlers = new Dictionary<ButtonWidget, DialogEventHandler>() ~ delete _;
|
||||||
|
|
|
@ -131,9 +131,14 @@ WinBFWindow::WinBFWindow(BFWindow* parent, const StringImpl& title, int x, int y
|
||||||
RECT desktopRect;
|
RECT desktopRect;
|
||||||
::SystemParametersInfo(SPI_GETWORKAREA, NULL, &desktopRect, NULL);
|
::SystemParametersInfo(SPI_GETWORKAREA, NULL, &desktopRect, NULL);
|
||||||
|
|
||||||
if (x + width >= desktopRect.right)
|
if (x < desktopRect.left)
|
||||||
|
x = desktopRect.left;
|
||||||
|
else if (x + width >= desktopRect.right)
|
||||||
x = BF_MAX((int)desktopRect.left, desktopRect.right - width);
|
x = BF_MAX((int)desktopRect.left, desktopRect.right - width);
|
||||||
if (y + height >= desktopRect.bottom)
|
|
||||||
|
if (y < desktopRect.top)
|
||||||
|
y = desktopRect.top;
|
||||||
|
else if (y + height >= desktopRect.bottom)
|
||||||
y = BF_MAX((int)desktopRect.top, desktopRect.bottom - height);
|
y = BF_MAX((int)desktopRect.top, desktopRect.bottom - height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ namespace IDE.ui
|
||||||
public this()
|
public this()
|
||||||
{
|
{
|
||||||
mWindowFlags = BFWindow.Flags.ClientSized | BFWindow.Flags.TopMost | BFWindow.Flags.Caption |
|
mWindowFlags = BFWindow.Flags.ClientSized | BFWindow.Flags.TopMost | BFWindow.Flags.Caption |
|
||||||
BFWindow.Flags.Border | BFWindow.Flags.SysMenu | BFWindow.Flags.Resizable;
|
BFWindow.Flags.Border | BFWindow.Flags.SysMenu | BFWindow.Flags.Resizable | .PopupPosition;
|
||||||
|
|
||||||
AddOkCancelButtons(new (evt) => { Attach(); }, null, 0, 1);
|
AddOkCancelButtons(new (evt) => { Attach(); }, null, 0, 1);
|
||||||
//mApplyButton = AddButton("Apply", (evt) => { evt.mCloseDialog = false; ApplyChanges(); });
|
//mApplyButton = AddButton("Apply", (evt) => { evt.mCloseDialog = false; ApplyChanges(); });
|
||||||
|
|
|
@ -1044,9 +1044,12 @@ namespace IDE.ui
|
||||||
|
|
||||||
mTargetEditWidget.Content.GetTextCoordAtCursor(var cursorX, var cursorY);
|
mTargetEditWidget.Content.GetTextCoordAtCursor(var cursorX, var cursorY);
|
||||||
|
|
||||||
if (!mInvokeWidget.mIsAboveText)
|
if (mInvokeWidget?.mIsAboveText != true)
|
||||||
y = Math.Max(y, cursorY + gApp.mCodeFont.GetHeight() * 0.0f);
|
y = Math.Max(y, cursorY + gApp.mCodeFont.GetHeight() * 0.0f);
|
||||||
|
|
||||||
|
/*if (cursorY > y + gApp.mCodeFont.GetHeight() * 2.5f)
|
||||||
|
y = cursorY;*/
|
||||||
|
|
||||||
float screenX;
|
float screenX;
|
||||||
float screenY;
|
float screenY;
|
||||||
mTargetEditWidget.Content.SelfToRootTranslate(x, y, out screenX, out screenY);
|
mTargetEditWidget.Content.SelfToRootTranslate(x, y, out screenX, out screenY);
|
||||||
|
|
|
@ -28,7 +28,7 @@ namespace IDE.ui
|
||||||
|
|
||||||
mIsReplace = isReplace;
|
mIsReplace = isReplace;
|
||||||
mWindowFlags = BFWindow.Flags.ClientSized | BFWindow.Flags.TopMost | BFWindow.Flags.Caption |
|
mWindowFlags = BFWindow.Flags.ClientSized | BFWindow.Flags.TopMost | BFWindow.Flags.Caption |
|
||||||
BFWindow.Flags.Border | BFWindow.Flags.SysMenu | BFWindow.Flags.Resizable;
|
BFWindow.Flags.Border | BFWindow.Flags.SysMenu | BFWindow.Flags.Resizable | .PopupPosition;
|
||||||
|
|
||||||
AddOkCancelButtons(new (evt) => { DoFind(); }, null, 0, 1);
|
AddOkCancelButtons(new (evt) => { DoFind(); }, null, 0, 1);
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ namespace IDE.ui
|
||||||
|
|
||||||
public this()
|
public this()
|
||||||
{
|
{
|
||||||
mWindowFlags = .ClientSized | .TopMost | .Caption | .Border | .SysMenu | .Resizable;
|
mWindowFlags = .ClientSized | .TopMost | .Caption | .Border | .SysMenu | .Resizable | .PopupPosition;
|
||||||
|
|
||||||
AddOkCancelButtons(new (evt) => { GotoClass(); }, null, 0, 1);
|
AddOkCancelButtons(new (evt) => { GotoClass(); }, null, 0, 1);
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ namespace IDE.ui
|
||||||
|
|
||||||
public this()
|
public this()
|
||||||
{
|
{
|
||||||
mWindowFlags = .ClientSized | .TopMost | .Caption | .Border | .SysMenu | .Resizable;
|
mWindowFlags = .ClientSized | .TopMost | .Caption | .Border | .SysMenu | .Resizable | .PopupPosition;
|
||||||
|
|
||||||
AddOkCancelButtons(new (evt) => { DoImport(); }, null, 0, 1);
|
AddOkCancelButtons(new (evt) => { DoImport(); }, null, 0, 1);
|
||||||
//mApplyButton = AddButton("Apply", (evt) => { evt.mCloseDialog = false; ApplyChanges(); });
|
//mApplyButton = AddButton("Apply", (evt) => { evt.mCloseDialog = false; ApplyChanges(); });
|
||||||
|
|
|
@ -31,7 +31,7 @@ namespace IDE.ui
|
||||||
mSettingHistoryManager = gApp.mLaunchHistoryManager;
|
mSettingHistoryManager = gApp.mLaunchHistoryManager;
|
||||||
|
|
||||||
mTitle = new .("Launch Executable");
|
mTitle = new .("Launch Executable");
|
||||||
mWindowFlags = .ClientSized | .TopMost | .Caption | .Border | .SysMenu | .Resizable;
|
mWindowFlags = .ClientSized | .TopMost | .Caption | .Border | .SysMenu | .Resizable | .PopupPosition;
|
||||||
|
|
||||||
AddOkCancelButtons(new (evt) => { evt.mCloseDialog = false; Launch(); }, null, 0, 1);
|
AddOkCancelButtons(new (evt) => { evt.mCloseDialog = false; Launch(); }, null, 0, 1);
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,7 @@ namespace IDE.ui
|
||||||
|
|
||||||
public this()
|
public this()
|
||||||
{
|
{
|
||||||
mWindowFlags = .ClientSized | .TopMost | .Caption | .Border | .SysMenu | .Resizable;
|
mWindowFlags = .ClientSized | .TopMost | .Caption | .Border | .SysMenu | .Resizable | .PopupPosition;
|
||||||
|
|
||||||
AddOkCancelButtons(new (evt) => { GotoFile(); }, null, 0, 1);
|
AddOkCancelButtons(new (evt) => { GotoFile(); }, null, 0, 1);
|
||||||
//mApplyButton = AddButton("Apply", (evt) => { evt.mCloseDialog = false; ApplyChanges(); });
|
//mApplyButton = AddButton("Apply", (evt) => { evt.mCloseDialog = false; ApplyChanges(); });
|
||||||
|
|
|
@ -11,7 +11,7 @@ namespace IDE.ui
|
||||||
class PanelPopup : Widget
|
class PanelPopup : Widget
|
||||||
{
|
{
|
||||||
public Panel mPanel;
|
public Panel mPanel;
|
||||||
public BFWindowBase.Flags mWindowFlags = .ClientSized | .NoActivate | .NoMouseActivate | .DestAlpha;
|
public BFWindowBase.Flags mWindowFlags = .ClientSized | .NoActivate | .NoMouseActivate | .DestAlpha | .PopupPosition;
|
||||||
Widget mRelativeWidget;
|
Widget mRelativeWidget;
|
||||||
bool mReverse;
|
bool mReverse;
|
||||||
float mMinContainerWidth = 32;
|
float mMinContainerWidth = 32;
|
||||||
|
|
|
@ -25,7 +25,7 @@ namespace IDE.ui
|
||||||
AddDialogComponent(mThreadCombo);
|
AddDialogComponent(mThreadCombo);
|
||||||
|
|
||||||
mWindowFlags = BFWindow.Flags.ClientSized | BFWindow.Flags.TopMost | BFWindow.Flags.Caption |
|
mWindowFlags = BFWindow.Flags.ClientSized | BFWindow.Flags.TopMost | BFWindow.Flags.Caption |
|
||||||
BFWindow.Flags.Border | BFWindow.Flags.SysMenu | BFWindow.Flags.Resizable;
|
BFWindow.Flags.Border | BFWindow.Flags.SysMenu | BFWindow.Flags.Resizable | .PopupPosition;
|
||||||
|
|
||||||
mSampleRateEdit = AddEdit(scope String()..AppendF("{0}", gApp.mSettings.mDebuggerSettings.mProfileSampleRate));
|
mSampleRateEdit = AddEdit(scope String()..AppendF("{0}", gApp.mSettings.mDebuggerSettings.mProfileSampleRate));
|
||||||
|
|
||||||
|
|
|
@ -497,7 +497,7 @@ namespace IDE.ui
|
||||||
{
|
{
|
||||||
//mMinWidth = GS!(320);
|
//mMinWidth = GS!(320);
|
||||||
|
|
||||||
mWindowFlags = .ClientSized | .TopMost | .Caption | .Border | .SysMenu | .Resizable;
|
mWindowFlags = .ClientSized | .TopMost | .Caption | .Border | .SysMenu | .Resizable | .PopupPosition;
|
||||||
|
|
||||||
mButtonBottomMargin = GS!(6);
|
mButtonBottomMargin = GS!(6);
|
||||||
mButtonRightMargin = GS!(6);
|
mButtonRightMargin = GS!(6);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue