diff --git a/res/mdpi/toolbar_control_disabled.9.png b/res/mdpi/toolbar_control_disabled.9.png
new file mode 100644
index 00000000..1ecea1bb
Binary files /dev/null and b/res/mdpi/toolbar_control_disabled.9.png differ
diff --git a/res/mdpi/toolbar_control_normal.9.png b/res/mdpi/toolbar_control_normal.9.png
new file mode 100644
index 00000000..3e94da9c
Binary files /dev/null and b/res/mdpi/toolbar_control_normal.9.png differ
diff --git a/res/theme_default.xml b/res/theme_default.xml
index add1b54e..0b1b8bbe 100644
--- a/res/theme_default.xml
+++ b/res/theme_default.xml
@@ -297,6 +297,12 @@
margins="1,1,1,1"
padding="4,4,4,4"
/>
+
diff --git a/res/toolbar_control_background.xml b/res/toolbar_control_background.xml
new file mode 100644
index 00000000..4b0df5f7
--- /dev/null
+++ b/res/toolbar_control_background.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
diff --git a/src/dlangui/widgets/editors.d b/src/dlangui/widgets/editors.d
index 47561dbe..291837ee 100644
--- a/src/dlangui/widgets/editors.d
+++ b/src/dlangui/widgets/editors.d
@@ -1072,7 +1072,7 @@ class EditableContent {
}
}
/// save to file in current format
- bool save(string filename) {
+ bool save(string filename = null) {
return save(filename, _format);
}
}
diff --git a/src/dlangui/widgets/styles.d b/src/dlangui/widgets/styles.d
index d4fd06c2..6c82662b 100644
--- a/src/dlangui/widgets/styles.d
+++ b/src/dlangui/widgets/styles.d
@@ -148,6 +148,8 @@ immutable string STYLE_TOOLBAR_HOST = "TOOLBAR_HOST";
immutable string STYLE_TOOLBAR = "TOOLBAR";
/// standard style id for toolbar button
immutable string STYLE_TOOLBAR_BUTTON = "TOOLBAR_BUTTON";
+/// standard style id for toolbar control, e.g. combobox
+immutable string STYLE_TOOLBAR_CONTROL = "TOOLBAR_CONTROL";
/// standard style id for toolbar separator
immutable string STYLE_TOOLBAR_SEPARATOR = "TOOLBAR_SEPARATOR";
diff --git a/src/dlangui/widgets/toolbars.d b/src/dlangui/widgets/toolbars.d
index b9d6b9e3..a0a5d910 100644
--- a/src/dlangui/widgets/toolbars.d
+++ b/src/dlangui/widgets/toolbars.d
@@ -24,6 +24,7 @@ module dlangui.widgets.toolbars;
import dlangui.widgets.widget;
import dlangui.widgets.layouts;
import dlangui.widgets.controls;
+import dlangui.widgets.combobox;
/// Layout with several toolbars
class ToolBarHost : HorizontalLayout {
@@ -76,6 +77,16 @@ class ToolBarSeparator : ImageWidget {
}
}
+/// separator for toolbars
+class ToolBarComboBox : ComboBox {
+ this(string ID, dstring[] items) {
+ super(ID, items);
+ styleId = STYLE_TOOLBAR_CONTROL;
+ if (items.length > 0)
+ selectedItemIndex = 0;
+ }
+}
+
/// Layout with buttons
class ToolBar : HorizontalLayout {
this(string ID) {
@@ -106,4 +117,8 @@ class ToolBar : HorizontalLayout {
}
}
+ void addControl(Widget widget) {
+ addChild(widget);
+ }
+
}