fix editbox and combobox styles

This commit is contained in:
Vadim Lopatin 2015-01-14 17:04:36 +03:00
parent a157a5314d
commit 6efd603d17
8 changed files with 30 additions and 3 deletions

View File

@ -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

View File

@ -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"

View File

@ -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;
}
}

View File

@ -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) {