mirror of https://github.com/buggins/dlangui.git
file dialogs in popup by default; update style for floating windows
This commit is contained in:
parent
cf75dd3496
commit
90cf7253ca
|
@ -64,6 +64,17 @@ class Dialog : VerticalLayout {
|
||||||
_icon = "dlangui-logo1";
|
_icon = "dlangui-logo1";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Measure widget according to desired width and height constraints. (Step 1 of two phase layout).
|
||||||
|
*/
|
||||||
|
void measure(int parentWidth, int parentHeight) {
|
||||||
|
super.measure(parentWidth, parentHeight);
|
||||||
|
if ((_flags & DialogFlag.Resizable) && (_flags & DialogFlag.Popup)) {
|
||||||
|
Point sz = Point(_parentWindow.width * 4 / 5, _parentWindow.height * 4 / 5);
|
||||||
|
measuredContent(parentWidth, parentHeight, sz.x, sz.y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// get icon resource id
|
/// get icon resource id
|
||||||
@property string windowIcon() {
|
@property string windowIcon() {
|
||||||
return _icon;
|
return _icon;
|
||||||
|
@ -204,6 +215,7 @@ class DialogFrame : WindowFrame {
|
||||||
protected Dialog _dialog;
|
protected Dialog _dialog;
|
||||||
this(Dialog dialog, bool enableCloseButton) {
|
this(Dialog dialog, bool enableCloseButton) {
|
||||||
super(dialog.id ~ "_frame", enableCloseButton);
|
super(dialog.id ~ "_frame", enableCloseButton);
|
||||||
|
styleId = STYLE_FLOATING_WINDOW;
|
||||||
_dialog = dialog;
|
_dialog = dialog;
|
||||||
_caption.text = _dialog.windowCaption.value;
|
_caption.text = _dialog.windowCaption.value;
|
||||||
bodyWidget = _dialog;
|
bodyWidget = _dialog;
|
||||||
|
|
|
@ -69,6 +69,8 @@ struct FileFilterEntry {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
__gshared bool SHOW_FILE_DIALOG_IN_POPUP = true;
|
||||||
|
|
||||||
/// File open / save dialog
|
/// File open / save dialog
|
||||||
class FileDialog : Dialog, CustomGridCellAdapter {
|
class FileDialog : Dialog, CustomGridCellAdapter {
|
||||||
protected FilePathPanel _edPath;
|
protected FilePathPanel _edPath;
|
||||||
|
@ -90,7 +92,7 @@ class FileDialog : Dialog, CustomGridCellAdapter {
|
||||||
protected bool _isOpenDialog;
|
protected bool _isOpenDialog;
|
||||||
|
|
||||||
this(UIString caption, Window parent, Action action = null, uint fileDialogFlags = DialogFlag.Modal | DialogFlag.Resizable | FileDialogFlag.FileMustExist) {
|
this(UIString caption, Window parent, Action action = null, uint fileDialogFlags = DialogFlag.Modal | DialogFlag.Resizable | FileDialogFlag.FileMustExist) {
|
||||||
super(caption, parent, fileDialogFlags);
|
super(caption, parent, fileDialogFlags | (SHOW_FILE_DIALOG_IN_POPUP ? DialogFlag.Popup : 0));
|
||||||
_isOpenDialog = !(_flags & FileDialogFlag.ConfirmOverwrite);
|
_isOpenDialog = !(_flags & FileDialogFlag.ConfirmOverwrite);
|
||||||
if (action is null) {
|
if (action is null) {
|
||||||
if (_isOpenDialog)
|
if (_isOpenDialog)
|
||||||
|
|
|
@ -134,6 +134,8 @@ immutable string STYLE_DOCK_WINDOW = "DOCK_WINDOW";
|
||||||
immutable string STYLE_DOCK_WINDOW_CAPTION_LABEL = "DOCK_WINDOW_CAPTION_LABEL";
|
immutable string STYLE_DOCK_WINDOW_CAPTION_LABEL = "DOCK_WINDOW_CAPTION_LABEL";
|
||||||
/// standard style id for dock window body
|
/// standard style id for dock window body
|
||||||
immutable string STYLE_DOCK_WINDOW_BODY = "DOCK_WINDOW_BODY";
|
immutable string STYLE_DOCK_WINDOW_BODY = "DOCK_WINDOW_BODY";
|
||||||
|
/// standard style id for toolbar separator
|
||||||
|
immutable string STYLE_FLOATING_WINDOW = "FLOATING_WINDOW";
|
||||||
|
|
||||||
/// standard style id for tab control in dock frame
|
/// standard style id for tab control in dock frame
|
||||||
immutable string STYLE_TAB_UP_DARK = "TAB_UP_DARK";
|
immutable string STYLE_TAB_UP_DARK = "TAB_UP_DARK";
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 556 B |
|
@ -263,6 +263,13 @@
|
||||||
padding="1,1,1,1"
|
padding="1,1,1,1"
|
||||||
margins="4,4,4,4"
|
margins="4,4,4,4"
|
||||||
/>
|
/>
|
||||||
|
<style id="FLOATING_WINDOW"
|
||||||
|
backgroundImageId="popup_window_background"
|
||||||
|
layoutWidth="FILL_PARENT"
|
||||||
|
layoutHeight="FILL_PARENT"
|
||||||
|
padding="1,1,1,1"
|
||||||
|
margins="4,4,4,4"
|
||||||
|
/>
|
||||||
<style id="DOCK_WINDOW_CAPTION"
|
<style id="DOCK_WINDOW_CAPTION"
|
||||||
backgroundColor="#4d6082"
|
backgroundColor="#4d6082"
|
||||||
layoutWidth="FILL_PARENT"
|
layoutWidth="FILL_PARENT"
|
||||||
|
|
|
@ -66,6 +66,7 @@ res/mdpi/folder-bookmark.png
|
||||||
res/mdpi/folder-network.png
|
res/mdpi/folder-network.png
|
||||||
res/mdpi/folder.png
|
res/mdpi/folder.png
|
||||||
res/mdpi/media-flash-sd-mmc.png
|
res/mdpi/media-flash-sd-mmc.png
|
||||||
|
res/mdpi/popup_window_background.9.png
|
||||||
res/mdpi/tab_btn_dark_up_focused.9.png
|
res/mdpi/tab_btn_dark_up_focused.9.png
|
||||||
res/mdpi/tab_btn_dark_up_focused_selected.9.png
|
res/mdpi/tab_btn_dark_up_focused_selected.9.png
|
||||||
res/mdpi/tab_btn_dark_up_hover.9.png
|
res/mdpi/tab_btn_dark_up_hover.9.png
|
||||||
|
|
Loading…
Reference in New Issue