mirror of https://github.com/buggins/dlangui.git
fix editbox and combobox styles
This commit is contained in:
parent
a157a5314d
commit
6efd603d17
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true"
|
||||
android:drawable="@drawable/btn_pressed" />
|
||||
<item android:state_focused="true" android:state_default="true" android:state_enabled="true"
|
||||
android:drawable="@drawable/btn_default" />
|
||||
<item android:state_focused="true" android:state_enabled="true"
|
||||
android:drawable="@drawable/btn_default" />
|
||||
<item android:state_enabled="true" android:state_default="true"
|
||||
android:drawable="@drawable/btn_default" />
|
||||
<item android:state_enabled="true" android:state_hovered="true"
|
||||
android:drawable="@drawable/btn_hover" />
|
||||
<item android:state_enabled="true"
|
||||
android:drawable="@drawable/btn_normal" />
|
||||
<item
|
||||
android:drawable="@drawable/btn_disabled" />
|
||||
</selector>
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 239 B After Width: | Height: | Size: 257 B |
Binary file not shown.
Before Width: | Height: | Size: 3.3 KiB |
Binary file not shown.
Before Width: | Height: | Size: 231 B After Width: | Height: | Size: 259 B |
Binary file not shown.
Before Width: | Height: | Size: 3.3 KiB |
|
@ -183,7 +183,7 @@
|
|||
/>
|
||||
|
||||
<style id="COMBO_BOX"
|
||||
backgroundImageId="btn_background"
|
||||
backgroundImageId="combobox_background"
|
||||
padding="2,2,2,2"
|
||||
margins="2,2,2,2"
|
||||
minWidth="40"
|
||||
|
|
|
@ -144,6 +144,8 @@ class ComboBoxBase : HorizontalLayout, OnClickHandler {
|
|||
//_body.state = State.Parent;
|
||||
//focusable = true;
|
||||
_button.focusable = false;
|
||||
_body.focusable = false;
|
||||
focusable = true;
|
||||
//_body.focusable = true;
|
||||
addChild(_body);
|
||||
addChild(_button);
|
||||
|
@ -276,8 +278,8 @@ class ComboEdit : ComboBox {
|
|||
|
||||
override void init() {
|
||||
super.init();
|
||||
focusable = false;
|
||||
_body.focusable = true;
|
||||
//focusable = false;
|
||||
//_body.focusable = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -926,6 +926,13 @@ class EditWidgetBase : ScrollWidgetBase, EditableContentListener, MenuItemAction
|
|||
return true;
|
||||
}
|
||||
|
||||
/// returns true if widget is focusable and visible and enabled
|
||||
override @property bool canFocus() {
|
||||
// allow to focus even if not enabled
|
||||
return focusable && visible;
|
||||
}
|
||||
|
||||
|
||||
/// override to change popup menu items state
|
||||
override bool isActionEnabled(const Action action) {
|
||||
switch (action.id) {
|
||||
|
|
Loading…
Reference in New Issue