feat: bar 点击回调添加按键和修饰键参数
on_click 新增 modifiers/button,使 bar item 可按按键与修饰键区分动作; 因参数增多,回调与 bar_click 改用结构参数封装。同时将 button_t 与 modifier 类型提升至公开头 include/zdwm/types.h 以供使用
This commit is contained in:
@@ -143,13 +143,10 @@ static void bar_workspaces_update(
|
||||
data->dirty = false;
|
||||
}
|
||||
|
||||
static zdwm_action_t bar_workspace_on_click(
|
||||
zdwm_bar_item_t *item,
|
||||
size_t cell_index,
|
||||
int32_t x,
|
||||
void *state
|
||||
) {
|
||||
auto data = (bar_workspace_state_t *)state;
|
||||
static zdwm_action_t bar_workspace_on_click(zdwm_bar_click_params_t *params) {
|
||||
auto cell_index = params->cell_index;
|
||||
auto data = (bar_workspace_state_t *)params->state;
|
||||
|
||||
if (cell_index == data->count) {
|
||||
return (zdwm_action_t){
|
||||
.type = ZDWM_ACTION_LAYOUT_CYCLE,
|
||||
|
||||
Reference in New Issue
Block a user