首页 > 解决方案 > 是否可以在键盘绑定 gtk.css 文件中使用“if-then-else”语句?

问题描述

这里是否可以单独使用箭头键在 Linux 上的 Eclipse 中的包资源管理器中展开树节点?我找到了改变 Eclipse 中树视图行为的好主意。我想改进它,但我不知道该怎么做,因为我在 gtk.css 配置文件中找不到使用 if-then-else 语句的示例。

我在https://developer.gnome.org/gtk3/stable/GtkTreeView.html#GtkTreeView-select-cursor-的参考文献中找到了两种方法“test-collapse-row”和“test-expand-row”行来测试当前行是否可扩展。我试图找到一个具有 css 键绑定条件的示例,但尚未找到。

@binding-set MyTreeViewBinding
{
   bind "Left"     { "select-cursor-parent" ()
                  "expand-collapse-cursor-row" (0,0,0) };
   /* I've try code below instead code above - isn't work
   bind "Left"     { if ("test-expand-row" ()) 
                         "expand-collapse-cursor-row" (0,0,0) 
                     else 
                         "select-cursor-parent" () }; */
   bind "Right"    { "expand-collapse-cursor-row" (0,1,0) };
}

treeview
{
   -gtk-key-bindings: MyTreeViewBinding;
}

我需要它是否节点,并且它没有折叠折叠它,但如果它不是节点或它已经折叠,则设置指向父级的指针,但不要折叠它。

标签: linuxeclipseubuntuidekeyboard-shortcuts

解决方案


推荐阅读