improve restack

This commit is contained in:
lixianjing 2022-11-15 11:30:12 +08:00
parent b3f0aa1649
commit ef4118b278
17 changed files with 116 additions and 37 deletions

View File

@ -130,6 +130,11 @@ static ret_t update_title_on_timer(const timer_info_t* info) {
return RET_REPEAT;
}
static ret_t popup_move_to_foreground(void* ctx, event_t* e){
window_manager_switch_to(window_manager(), window_manager_get_top_main_window(window_manager()), ctx, FALSE);
return RET_OK;
}
static void open_window(const char* name, widget_t* to_close) {
bool_t is_single_main_win =
widget_lookup(window_manager(), DEMOUI_MAIN_WINDOW_NAME, FALSE) == NULL;
@ -155,6 +160,10 @@ static void open_window(const char* name, widget_t* to_close) {
widget_add_timer(win, update_title_on_timer, 1000);
}
if (tk_str_eq(name, "popup_on_top")) {
widget_on(win, EVT_WINDOW_TO_BACKGROUND, popup_move_to_foreground, win);
}
if (tk_str_eq(widget_get_type(win), WIDGET_TYPE_DIALOG)) {
int32_t ret = dialog_modal(win);

View File

@ -54,6 +54,7 @@
<button focusable="true" name="open:slider" text="Slider"/>
<button focusable="true" name="open:close_window" text="close_window"/>
<button focusable="true" name="open:dialog_highlight" text="Dialog Highlight"/>
<button focusable="true" name="open:popup_on_top" text="Popup On Top"/>
</view>
<view x="0" y="0" w="100%" h="100%" children_layout="default(c=1,r=8,m=5,s=5)">
<button focusable="true" name="open:memtest" text="MemTest"/>

View File

@ -1,5 +1,8 @@
# 最新动态
2022/11/15
* 修复使用combo\_box控件打开下拉列表的同时调用window\_manager\_switch\_to改变窗口顺序导致popup无法正常显示的问题(感谢泽武提供补丁)
2022/11/14
* uiex 增加 spin\_box 样式(感谢兆坤提供补丁)
* uiex 增加 scroll\_left scroll\_right 按钮样式(感谢兆坤提供补丁)

View File

@ -98,6 +98,7 @@ extern TK_CONST_DATA_ALIGN(const unsigned char ui_menu_down_right[]);
extern TK_CONST_DATA_ALIGN(const unsigned char ui_tab_bottom[]);
extern TK_CONST_DATA_ALIGN(const unsigned char ui_list_view_m[]);
extern TK_CONST_DATA_ALIGN(const unsigned char ui_slide_view_h_loop[]);
extern TK_CONST_DATA_ALIGN(const unsigned char ui_popup_on_top[]);
extern TK_CONST_DATA_ALIGN(const unsigned char ui_main_fscript[]);
extern TK_CONST_DATA_ALIGN(const unsigned char ui_mutable_image[]);
extern TK_CONST_DATA_ALIGN(const unsigned char ui_calibration_win[]);
@ -996,6 +997,7 @@ ret_t assets_init_dark(void) {
assets_manager_add(am, ui_tab_bottom);
assets_manager_add(am, ui_list_view_m);
assets_manager_add(am, ui_slide_view_h_loop);
assets_manager_add(am, ui_popup_on_top);
assets_manager_add(am, ui_main_fscript);
assets_manager_add(am, ui_mutable_image);
assets_manager_add(am, ui_calibration_win);

View File

@ -98,6 +98,7 @@
#include "default/inc/ui/tab_bottom.data"
#include "default/inc/ui/list_view_m.data"
#include "default/inc/ui/slide_view_h_loop.data"
#include "default/inc/ui/popup_on_top.data"
#include "default/inc/ui/main_fscript.data"
#include "default/inc/ui/mutable_image.data"
#include "default/inc/ui/calibration_win.data"
@ -996,6 +997,7 @@ ret_t assets_init_default(void) {
assets_manager_add(am, ui_tab_bottom);
assets_manager_add(am, ui_list_view_m);
assets_manager_add(am, ui_slide_view_h_loop);
assets_manager_add(am, ui_popup_on_top);
assets_manager_add(am, ui_main_fscript);
assets_manager_add(am, ui_mutable_image);
assets_manager_add(am, ui_calibration_win);

View File

@ -93,6 +93,7 @@ extern TK_CONST_DATA_ALIGN(const unsigned char ui_menu_down_right[]);
extern TK_CONST_DATA_ALIGN(const unsigned char ui_tab_bottom[]);
extern TK_CONST_DATA_ALIGN(const unsigned char ui_list_view_m[]);
extern TK_CONST_DATA_ALIGN(const unsigned char ui_slide_view_h_loop[]);
extern TK_CONST_DATA_ALIGN(const unsigned char ui_popup_on_top[]);
extern TK_CONST_DATA_ALIGN(const unsigned char ui_main_fscript[]);
extern TK_CONST_DATA_ALIGN(const unsigned char ui_mutable_image[]);
extern TK_CONST_DATA_ALIGN(const unsigned char ui_calibration_win[]);
@ -613,6 +614,7 @@ ret_t assets_init_dark(void) {
assets_manager_add(am, ui_tab_bottom);
assets_manager_add(am, ui_list_view_m);
assets_manager_add(am, ui_slide_view_h_loop);
assets_manager_add(am, ui_popup_on_top);
assets_manager_add(am, ui_main_fscript);
assets_manager_add(am, ui_mutable_image);
assets_manager_add(am, ui_calibration_win);

View File

@ -93,6 +93,7 @@
#include "default/inc/ui/tab_bottom.data"
#include "default/inc/ui/list_view_m.data"
#include "default/inc/ui/slide_view_h_loop.data"
#include "default/inc/ui/popup_on_top.data"
#include "default/inc/ui/main_fscript.data"
#include "default/inc/ui/mutable_image.data"
#include "default/inc/ui/calibration_win.data"
@ -613,6 +614,7 @@ ret_t assets_init_default(void) {
assets_manager_add(am, ui_tab_bottom);
assets_manager_add(am, ui_list_view_m);
assets_manager_add(am, ui_slide_view_h_loop);
assets_manager_add(am, ui_popup_on_top);
assets_manager_add(am, ui_main_fscript);
assets_manager_add(am, ui_mutable_image);
assets_manager_add(am, ui_calibration_win);

View File

@ -1,5 +1,5 @@
TK_CONST_DATA_ALIGN(const unsigned char ui_main[]) = {
0x04,0x00,0x01,0x01,0x2c,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x6d,0x61,0x69,0x6e,0x00,0x00,0x00,0x00,
0x04,0x00,0x01,0x01,0x96,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x6d,0x61,0x69,0x6e,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x12,0x12,0x22,0x11,0x77,0x69,0x6e,0x64,0x6f,0x77,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
@ -268,46 +268,52 @@ TK_CONST_DATA_ALIGN(const unsigned char ui_main[]) = {
0x00,0x00,0x00,0x00,0x00,0x66,0x6f,0x63,0x75,0x73,0x61,0x62,0x6c,0x65,0x00,0x74,0x72,0x75,0x65,0x00,
0x6e,0x61,0x6d,0x65,0x00,0x6f,0x70,0x65,0x6e,0x3a,0x64,0x69,0x61,0x6c,0x6f,0x67,0x5f,0x68,0x69,0x67,
0x68,0x6c,0x69,0x67,0x68,0x74,0x00,0x74,0x65,0x78,0x74,0x00,0x44,0x69,0x61,0x6c,0x6f,0x67,0x20,0x48,
0x69,0x67,0x68,0x6c,0x69,0x67,0x68,0x74,0x00,0x00,0x00,0x00,0x76,0x69,0x65,0x77,0x00,0x00,0x00,0x00,
0x69,0x67,0x68,0x6c,0x69,0x67,0x68,0x74,0x00,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0x64,0x00,0x00,0x00,
0x73,0x65,0x6c,0x66,0x5f,0x6c,0x61,0x79,0x6f,0x75,0x74,0x00,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x28,
0x78,0x3d,0x30,0x2c,0x79,0x3d,0x30,0x2c,0x77,0x3d,0x31,0x30,0x30,0x25,0x2c,0x68,0x3d,0x31,0x30,0x30,
0x25,0x29,0x00,0x63,0x68,0x69,0x6c,0x64,0x72,0x65,0x6e,0x5f,0x6c,0x61,0x79,0x6f,0x75,0x74,0x00,0x64,
0x65,0x66,0x61,0x75,0x6c,0x74,0x28,0x63,0x3d,0x31,0x2c,0x72,0x3d,0x38,0x2c,0x6d,0x3d,0x35,0x2c,0x73,
0x3d,0x35,0x29,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x66,
0x6f,0x63,0x75,0x73,0x61,0x62,0x6c,0x65,0x00,0x74,0x72,0x75,0x65,0x00,0x6e,0x61,0x6d,0x65,0x00,0x6f,
0x70,0x65,0x6e,0x3a,0x70,0x6f,0x70,0x75,0x70,0x5f,0x6f,0x6e,0x5f,0x74,0x6f,0x70,0x00,0x74,0x65,0x78,
0x74,0x00,0x50,0x6f,0x70,0x75,0x70,0x20,0x4f,0x6e,0x20,0x54,0x6f,0x70,0x00,0x00,0x00,0x00,0x76,0x69,
0x65,0x77,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x00,
0x00,0x00,0x64,0x00,0x00,0x00,0x73,0x65,0x6c,0x66,0x5f,0x6c,0x61,0x79,0x6f,0x75,0x74,0x00,0x64,0x65,
0x66,0x61,0x75,0x6c,0x74,0x28,0x78,0x3d,0x30,0x2c,0x79,0x3d,0x30,0x2c,0x77,0x3d,0x31,0x30,0x30,0x25,
0x2c,0x68,0x3d,0x31,0x30,0x30,0x25,0x29,0x00,0x63,0x68,0x69,0x6c,0x64,0x72,0x65,0x6e,0x5f,0x6c,0x61,
0x79,0x6f,0x75,0x74,0x00,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x28,0x63,0x3d,0x31,0x2c,0x72,0x3d,0x38,
0x2c,0x6d,0x3d,0x35,0x2c,0x73,0x3d,0x35,0x29,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x66,0x6f,0x63,0x75,0x73,0x61,0x62,
0x6c,0x65,0x00,0x74,0x72,0x75,0x65,0x00,0x6e,0x61,0x6d,0x65,0x00,0x6f,0x70,0x65,0x6e,0x3a,0x6d,0x65,
0x6d,0x74,0x65,0x73,0x74,0x00,0x74,0x65,0x78,0x74,0x00,0x4d,0x65,0x6d,0x54,0x65,0x73,0x74,0x00,0x00,
0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x66,
0x6f,0x63,0x75,0x73,0x61,0x62,0x6c,0x65,0x00,0x74,0x72,0x75,0x65,0x00,0x6e,0x61,0x6d,0x65,0x00,0x6f,
0x70,0x65,0x6e,0x3a,0x6d,0x65,0x6d,0x74,0x65,0x73,0x74,0x00,0x74,0x65,0x78,0x74,0x00,0x4d,0x65,0x6d,
0x54,0x65,0x73,0x74,0x00,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x66,0x6f,0x63,0x75,0x73,0x61,0x62,0x6c,0x65,0x00,0x74,
0x72,0x75,0x65,0x00,0x6e,0x61,0x6d,0x65,0x00,0x6f,0x70,0x65,0x6e,0x3a,0x63,0x61,0x6c,0x69,0x62,0x72,
0x61,0x74,0x69,0x6f,0x6e,0x5f,0x77,0x69,0x6e,0x00,0x74,0x65,0x78,0x74,0x00,0x43,0x61,0x6c,0x69,0x62,
0x72,0x61,0x74,0x69,0x6f,0x6e,0x00,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x66,0x6f,0x63,0x75,0x73,
0x61,0x62,0x6c,0x65,0x00,0x74,0x72,0x75,0x65,0x00,0x6e,0x61,0x6d,0x65,0x00,0x6f,0x70,0x65,0x6e,0x3a,
0x63,0x61,0x6c,0x69,0x62,0x72,0x61,0x74,0x69,0x6f,0x6e,0x5f,0x77,0x69,0x6e,0x00,0x74,0x65,0x78,0x74,
0x00,0x43,0x61,0x6c,0x69,0x62,0x72,0x61,0x74,0x69,0x6f,0x6e,0x00,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,
0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x66,0x6f,0x63,
0x75,0x73,0x61,0x62,0x6c,0x65,0x00,0x74,0x72,0x75,0x65,0x00,0x6e,0x61,0x6d,0x65,0x00,0x73,0x68,0x6f,
0x77,0x5f,0x66,0x70,0x73,0x00,0x74,0x65,0x78,0x74,0x00,0x53,0x68,0x6f,0x77,0x20,0x46,0x50,0x53,0x00,
0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x66,0x6f,0x63,0x75,0x73,0x61,0x62,0x6c,0x65,0x00,0x74,0x72,0x75,0x65,0x00,0x6e,0x61,
0x6d,0x65,0x00,0x73,0x68,0x6f,0x77,0x5f,0x66,0x70,0x73,0x00,0x74,0x65,0x78,0x74,0x00,0x53,0x68,0x6f,
0x77,0x20,0x46,0x50,0x53,0x00,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x66,0x6f,0x63,0x75,0x73,0x61,0x62,0x6c,0x65,0x00,
0x74,0x72,0x75,0x65,0x00,0x6e,0x61,0x6d,0x65,0x00,0x73,0x6e,0x61,0x70,0x73,0x68,0x6f,0x74,0x00,0x74,
0x65,0x78,0x74,0x00,0x54,0x61,0x6b,0x65,0x20,0x53,0x6e,0x61,0x70,0x73,0x68,0x6f,0x74,0x00,0x00,0x00,
0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x66,0x6f,0x63,0x75,0x73,0x61,0x62,0x6c,0x65,0x00,0x74,0x72,
0x75,0x65,0x00,0x6e,0x61,0x6d,0x65,0x00,0x72,0x65,0x6c,0x6f,0x61,0x64,0x5f,0x74,0x68,0x65,0x6d,0x65,
0x00,0x74,0x65,0x78,0x74,0x00,0x54,0x65,0x73,0x74,0x20,0x43,0x68,0x61,0x6e,0x67,0x65,0x20,0x54,0x68,
0x65,0x6d,0x65,0x00,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x66,0x6f,0x63,0x75,
0x73,0x61,0x62,0x6c,0x65,0x00,0x74,0x72,0x75,0x65,0x00,0x6e,0x61,0x6d,0x65,0x00,0x73,0x6e,0x61,0x70,
0x73,0x68,0x6f,0x74,0x00,0x74,0x65,0x78,0x74,0x00,0x54,0x61,0x6b,0x65,0x20,0x53,0x6e,0x61,0x70,0x73,
0x68,0x6f,0x74,0x00,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x66,0x6f,0x63,0x75,0x73,0x61,
0x62,0x6c,0x65,0x00,0x74,0x72,0x75,0x65,0x00,0x6e,0x61,0x6d,0x65,0x00,0x65,0x78,0x69,0x74,0x00,0x74,
0x65,0x78,0x74,0x00,0x45,0x78,0x69,0x74,0x00,0x00,0x00,0x00,0x00,0x73,0x6c,0x69,0x64,0x65,0x5f,0x69,
0x6e,0x64,0x69,0x63,0x61,0x74,0x6f,0x72,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0x14,0x00,0x00,
0x00,0x73,0x65,0x6c,0x66,0x5f,0x6c,0x61,0x79,0x6f,0x75,0x74,0x00,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,
0x28,0x78,0x3d,0x30,0x2c,0x79,0x3d,0x62,0x2c,0x77,0x3d,0x31,0x30,0x30,0x25,0x2c,0x68,0x3d,0x32,0x30,
0x29,0x00,0x74,0x72,0x61,0x6e,0x73,0x69,0x74,0x69,0x6f,0x6e,0x00,0x74,0x72,0x75,0x65,0x00,0x73,0x74,
0x79,0x6c,0x65,0x00,0x62,0x6c,0x75,0x65,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};/*6236*/
0x62,0x6c,0x65,0x00,0x74,0x72,0x75,0x65,0x00,0x6e,0x61,0x6d,0x65,0x00,0x72,0x65,0x6c,0x6f,0x61,0x64,
0x5f,0x74,0x68,0x65,0x6d,0x65,0x00,0x74,0x65,0x78,0x74,0x00,0x54,0x65,0x73,0x74,0x20,0x43,0x68,0x61,
0x6e,0x67,0x65,0x20,0x54,0x68,0x65,0x6d,0x65,0x00,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x66,0x6f,0x63,0x75,0x73,0x61,0x62,0x6c,0x65,0x00,0x74,0x72,0x75,0x65,0x00,0x6e,0x61,0x6d,0x65,0x00,
0x65,0x78,0x69,0x74,0x00,0x74,0x65,0x78,0x74,0x00,0x45,0x78,0x69,0x74,0x00,0x00,0x00,0x00,0x00,0x73,
0x6c,0x69,0x64,0x65,0x5f,0x69,0x6e,0x64,0x69,0x63,0x61,0x74,0x6f,0x72,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,
0x00,0x00,0x00,0x14,0x00,0x00,0x00,0x73,0x65,0x6c,0x66,0x5f,0x6c,0x61,0x79,0x6f,0x75,0x74,0x00,0x64,
0x65,0x66,0x61,0x75,0x6c,0x74,0x28,0x78,0x3d,0x30,0x2c,0x79,0x3d,0x62,0x2c,0x77,0x3d,0x31,0x30,0x30,
0x25,0x2c,0x68,0x3d,0x32,0x30,0x29,0x00,0x74,0x72,0x61,0x6e,0x73,0x69,0x74,0x69,0x6f,0x6e,0x00,0x74,
0x72,0x75,0x65,0x00,0x73,0x74,0x79,0x6c,0x65,0x00,0x62,0x6c,0x75,0x65,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,};/*6342*/

Binary file not shown.

View File

@ -98,6 +98,7 @@
#include "assets/default/inc/ui/tab_bottom.data"
#include "assets/default/inc/ui/list_view_m.data"
#include "assets/default/inc/ui/slide_view_h_loop.data"
#include "assets/default/inc/ui/popup_on_top.data"
#include "assets/default/inc/ui/main_fscript.data"
#include "assets/default/inc/ui/mutable_image.data"
#include "assets/default/inc/ui/calibration_win.data"
@ -996,6 +997,7 @@ ret_t assets_init(void) {
assets_manager_add(am, ui_tab_bottom);
assets_manager_add(am, ui_list_view_m);
assets_manager_add(am, ui_slide_view_h_loop);
assets_manager_add(am, ui_popup_on_top);
assets_manager_add(am, ui_main_fscript);
assets_manager_add(am, ui_mutable_image);
assets_manager_add(am, ui_calibration_win);

View File

@ -98,6 +98,7 @@
#include "assets/default/inc/ui/tab_bottom.data"
#include "assets/default/inc/ui/list_view_m.data"
#include "assets/default/inc/ui/slide_view_h_loop.data"
#include "assets/default/inc/ui/popup_on_top.data"
#include "assets/default/inc/ui/main_fscript.data"
#include "assets/default/inc/ui/mutable_image.data"
#include "assets/default/inc/ui/calibration_win.data"
@ -996,6 +997,7 @@ ret_t assets_init(void) {
assets_manager_add(am, ui_tab_bottom);
assets_manager_add(am, ui_list_view_m);
assets_manager_add(am, ui_slide_view_h_loop);
assets_manager_add(am, ui_popup_on_top);
assets_manager_add(am, ui_main_fscript);
assets_manager_add(am, ui_mutable_image);
assets_manager_add(am, ui_calibration_win);

View File

@ -93,6 +93,7 @@
#include "assets/default/inc/ui/tab_bottom.data"
#include "assets/default/inc/ui/list_view_m.data"
#include "assets/default/inc/ui/slide_view_h_loop.data"
#include "assets/default/inc/ui/popup_on_top.data"
#include "assets/default/inc/ui/main_fscript.data"
#include "assets/default/inc/ui/mutable_image.data"
#include "assets/default/inc/ui/calibration_win.data"
@ -613,6 +614,7 @@ ret_t assets_init(void) {
assets_manager_add(am, ui_tab_bottom);
assets_manager_add(am, ui_list_view_m);
assets_manager_add(am, ui_slide_view_h_loop);
assets_manager_add(am, ui_popup_on_top);
assets_manager_add(am, ui_main_fscript);
assets_manager_add(am, ui_mutable_image);
assets_manager_add(am, ui_calibration_win);

View File

@ -93,6 +93,7 @@
#include "assets/default/inc/ui/tab_bottom.data"
#include "assets/default/inc/ui/list_view_m.data"
#include "assets/default/inc/ui/slide_view_h_loop.data"
#include "assets/default/inc/ui/popup_on_top.data"
#include "assets/default/inc/ui/main_fscript.data"
#include "assets/default/inc/ui/mutable_image.data"
#include "assets/default/inc/ui/calibration_win.data"
@ -613,6 +614,7 @@ ret_t assets_init(void) {
assets_manager_add(am, ui_tab_bottom);
assets_manager_add(am, ui_list_view_m);
assets_manager_add(am, ui_slide_view_h_loop);
assets_manager_add(am, ui_popup_on_top);
assets_manager_add(am, ui_main_fscript);
assets_manager_add(am, ui_mutable_image);
assets_manager_add(am, ui_calibration_win);

View File

@ -440,6 +440,17 @@ typedef enum _event_type_t {
* (event_t)
*/
EVT_WIDGET_REMOVE_CHILD,
/**
* @const EVT_WIDGET_WILL_RESTACK_CHILD
* (event_t)
* RET_STOP停止调整动作
*/
EVT_WIDGET_WILL_RESTACK_CHILD,
/**
* @const EVT_WIDGET_RESTACK_CHILD
* (event_t)
*/
EVT_WIDGET_RESTACK_CHILD,
/**
* @const EVT_SCROLL_START
* scroll view开始滚动(event_t)

View File

@ -1145,6 +1145,13 @@ ret_t widget_restack(widget_t* widget, uint32_t index) {
widget_t** children = NULL;
return_value_if_fail(widget != NULL && widget->parent != NULL, RET_BAD_PARAMS);
event_t e = event_init(EVT_WIDGET_WILL_RESTACK_CHILD, widget->parent);
int32_t ret = widget_dispatch(widget->parent, &e);
if (ret != RET_OK) {
return RET_OK;
}
e = event_init(EVT_WIDGET_RESTACK_CHILD, widget->parent);
old_index = widget_index_of(widget);
nr = widget_count_children(widget->parent);
return_value_if_fail(old_index >= 0 && nr > 0, RET_BAD_PARAMS);
@ -1169,6 +1176,8 @@ ret_t widget_restack(widget_t* widget, uint32_t index) {
}
children[index] = widget;
widget_dispatch(widget, &e);
return RET_OK;
}

View File

@ -600,6 +600,17 @@ struct _widget_t {
*
*/
/**
* @event {event_t} EVT_WIDGET_WILL_RESTACK_CHILD
*
* RET_STOP停止调整动作
*/
/**
* @event {event_t} EVT_WIDGET_RESTACK_CHILD
*
*/
/**
* @event {prop_change_event_t} EVT_PROP_WILL_CHANGE
* (set_prop设置属性)

View File

@ -23,6 +23,7 @@
#include "tkc/utils.h"
#include "base/layout.h"
#include "base/window.h"
#include "base/window_manager.h"
#include "widgets/button.h"
#include "widgets/popup.h"
#include "widgets/combo_box.h"
@ -584,10 +585,21 @@ static ret_t combo_box_create_popup_items(combo_box_t* combo_box, widget_t* pare
return RET_OK;
}
static ret_t combo_box_popup_restack(void* ctx, event_t* e) {
combo_box_t* combo_box = COMBO_BOX(ctx);
return_value_if_fail(combo_box != NULL, RET_BAD_PARAMS);
if (combo_box->combobox_popup != NULL) {
return RET_STOP;
}
return RET_OK;
}
ret_t combo_box_combobox_popup_on_close_func(void* ctx, event_t* e) {
combo_box_t* combo_box = COMBO_BOX(ctx);
return_value_if_fail(combo_box != NULL, RET_BAD_PARAMS);
widget_off_by_func(window_manager(), EVT_WIDGET_WILL_RESTACK_CHILD, combo_box_popup_restack, combo_box);
combo_box->combobox_popup = NULL;
return RET_OK;
@ -658,6 +670,7 @@ static ret_t combo_box_active(widget_t* widget) {
widget_resize(win, widget->w, win->h);
widget_layout_children(win);
} else {
widget_on(window_manager(), EVT_WIDGET_WILL_RESTACK_CHILD, combo_box_popup_restack, combo_box);
if (combo_box->open_popup) {
win = combo_box->open_popup(widget);
return_value_if_fail(win != NULL, RET_FAIL);