fix default theme - better TAB control; disable main menu toggle by single Alt press for non-windows

This commit is contained in:
Vadim Lopatin 2016-10-10 10:25:24 +03:00
parent a210978161
commit 2c909b2c83
8 changed files with 26 additions and 17 deletions

View File

@ -952,6 +952,8 @@ class MainMenu : MenuWidgetBase {
} }
} }
// toggle menu by single Alt press - for Windows only!
version (Windows) {
if (event.action == KeyAction.KeyDown && isAlt && noOtherModifiers) { if (event.action == KeyAction.KeyDown && isAlt && noOtherModifiers) {
_menuToggleState = 1; _menuToggleState = 1;
} else if (event.action == KeyAction.KeyUp && isAlt && noOtherModifiers) { } else if (event.action == KeyAction.KeyUp && isAlt && noOtherModifiers) {
@ -965,6 +967,7 @@ class MainMenu : MenuWidgetBase {
toggle(); toggle();
return true; return true;
} }
}
if (!focused) if (!focused)
return false; return false;
if (_selectedItemIndex >= 0 && event.action == KeyAction.KeyDown && ((event.keyCode == KeyCode.DOWN) || (event.keyCode == KeyCode.SPACE) || (event.keyCode == KeyCode.RETURN))) { if (_selectedItemIndex >= 0 && event.action == KeyAction.KeyDown && ((event.keyCode == KeyCode.DOWN) || (event.keyCode == KeyCode.SPACE) || (event.keyCode == KeyCode.RETURN))) {

View File

@ -126,6 +126,10 @@ class TabItemWidget : HorizontalLayout {
styleId = tabButtonStyle; styleId = tabButtonStyle;
_label.styleId = tabButtonTextStyle; _label.styleId = tabButtonTextStyle;
} }
override void onDraw(DrawBuf buf) {
//debug Log.d("TabWidget.onDraw ", id);
super.onDraw(buf);
}
protected bool onClick(Widget source) { protected bool onClick(Widget source) {
if (source.compareId("CLOSE")) { if (source.compareId("CLOSE")) {
Log.d("tab close button pressed"); Log.d("tab close button pressed");
@ -522,6 +526,7 @@ class TabControl : WidgetGroupDefaultDrawing {
override void onDraw(DrawBuf buf) { override void onDraw(DrawBuf buf) {
if (visibility != Visibility.Visible) if (visibility != Visibility.Visible)
return; return;
//debug Log.d("TabControl.onDraw enter");
super.Widget.onDraw(buf); super.Widget.onDraw(buf);
Rect rc = _pos; Rect rc = _pos;
applyMargins(rc); applyMargins(rc);
@ -545,6 +550,7 @@ class TabControl : WidgetGroupDefaultDrawing {
continue; continue;
item.onDraw(buf); item.onDraw(buf);
} }
//debug Log.d("TabControl.onDraw exit");
} }
protected string _selectedTabId; protected string _selectedTabId;

View File

@ -3,12 +3,12 @@
android:constantSize="true" android:constantSize="true"
android:dither="false" android:dither="false"
android:variablePadding="false" > android:variablePadding="false" >
<item
android:drawable="tab_btn_up_hover"
android:state_hovered="true" />
<item <item
android:drawable="tab_btn_up_selected" android:drawable="tab_btn_up_selected"
android:state_selected="true" /> android:state_selected="true" />
<item
android:drawable="tab_btn_up_hover"
android:state_hovered="true" />
<item <item
android:drawable="tab_btn_up_normal" /> android:drawable="tab_btn_up_normal" />
</selector> </selector>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 266 B

After

Width:  |  Height:  |  Size: 472 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 286 B

After

Width:  |  Height:  |  Size: 483 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 267 B

After

Width:  |  Height:  |  Size: 471 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 263 B

After

Width:  |  Height:  |  Size: 238 B

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<theme id="theme_default" <theme id="theme_default"
fontSize="10pt" fontSize="11pt"
fontFace="Helvetica Neue,Verdana,Arial,DejaVu Sans,Liberation Sans,Helvetica,Roboto,Droid Sans" fontFace="Helvetica Neue,Verdana,Arial,DejaVu Sans,Liberation Sans,Helvetica,Roboto,Droid Sans"
fontFamily="SansSerif" fontFamily="SansSerif"
> >
@ -202,7 +202,7 @@
<state state_selected="true" state_focused="true" textColor="#000000"/> <state state_selected="true" state_focused="true" textColor="#000000"/>
<state state_selected="true" textColor="#000000"/> <state state_selected="true" textColor="#000000"/>
<state state_focused="true" textColor="#000000"/> <state state_focused="true" textColor="#000000"/>
<state state_hovered="true" textColor="#808000"/> <state state_hovered="true" textColor="#0000C0"/>
</style> </style>
<style id="TAB_UP_BUTTON" <style id="TAB_UP_BUTTON"
backgroundImageId="tab_btn_up" backgroundImageId="tab_btn_up"