mirror of https://github.com/buggins/dlangui.git
fix combobox style and disabled state handling for combobox
This commit is contained in:
parent
22bd6fac35
commit
e7cd6a2c9d
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
<item
|
||||
android:drawable="btn_disabled"
|
||||
android:drawable="@null"
|
||||
android:state_enabled="false"/>
|
||||
<item
|
||||
android:drawable="@null"
|
||||
|
@ -11,7 +11,7 @@
|
|||
android:state_pressed="true" />
|
||||
<item
|
||||
android:drawable="btn_hover"
|
||||
android:state_hovered="true" />
|
||||
android:state_hovered="true" android:state_enabled="true" />
|
||||
<item
|
||||
android:drawable="@null" />
|
||||
</selector>
|
||||
|
|
|
@ -190,6 +190,7 @@
|
|||
fontFamily="SansSerif"
|
||||
fontSize="16"
|
||||
/>
|
||||
|
||||
<style id="COMBO_BOX"
|
||||
backgroundImageId="btn_background"
|
||||
padding="2,2,2,2"
|
||||
|
@ -213,6 +214,7 @@
|
|||
backgroundImageId="btn_background_transparent"
|
||||
align="Center"
|
||||
/>
|
||||
|
||||
<style id="EDIT_BOX"
|
||||
backgroundImageId="editbox_background"
|
||||
padding="5,6,5,6"
|
||||
|
|
|
@ -73,8 +73,18 @@ class ComboBoxBase : HorizontalLayout, OnClickHandler {
|
|||
onItemClickListener(this, index);
|
||||
}
|
||||
|
||||
/// change enabled state
|
||||
override @property Widget enabled(bool flg) {
|
||||
super.enabled(flg);
|
||||
_button.enabled = flg;
|
||||
return this;
|
||||
}
|
||||
/// return true if state has State.Enabled flag set
|
||||
override @property bool enabled() { return super.enabled; }
|
||||
|
||||
override bool onClick(Widget source) {
|
||||
showPopup();
|
||||
if (enabled)
|
||||
showPopup();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue