diff options
author | portix <none@none> | 2012-07-29 20:41:46 +0200 |
---|---|---|
committer | portix <none@none> | 2012-07-29 20:41:46 +0200 |
commit | 6eebbc1778f12e6c6a7fc2b016431bd166c73be0 (patch) | |
tree | 9cd135af6c07c8fb570bbc7eeb0b53a3f12ce568 /src | |
parent | d4dafeb62ca99abe224e98612744f93e0e60572d (diff) | |
download | dwb-6eebbc1778f12e6c6a7fc2b016431bd166c73be0.zip |
Using GROUP_VISIBLE makro
Diffstat (limited to 'src')
-rw-r--r-- | src/commands.c | 11 | ||||
-rw-r--r-- | src/dwb.c | 2 | ||||
-rw-r--r-- | src/dwb.h | 3 |
3 files changed, 14 insertions, 2 deletions
diff --git a/src/commands.c b/src/commands.c index b48878ae..6991ca5f 100644 --- a/src/commands.c +++ b/src/commands.c @@ -895,18 +895,27 @@ commands_group_show(KeyMap *km, Arg *arg) { } DwbStatus commands_group_toggle(KeyMap *km, Arg *arg) { + int n = MIN(NUMMOD, 9), i=0; + dwb.state.current_groups ^= (1<<n); + for (GList *gl = dwb.state.views; gl; gl=gl->next, i++) { + + } + printf("%d\n", dwb.state.current_groups); return STATUS_OK; } DwbStatus commands_group_tag(KeyMap *km, Arg *arg) { int n = MIN(NUMMOD, 9); - puts("blub"); if (CURRENT_VIEW()->status->group & (1<<n)) { CURRENT_VIEW()->status->group &= ~(1<<n); + if (!GROUP_VISIBLE(dwb.state.fview)) + dwb_hide_tab(dwb.state.fview); dwb_set_normal_message(dwb.state.fview, true, "Untagged group %d", n); } else { CURRENT_VIEW()->status->group |= 1<<n; + if (GROUP_VISIBLE(dwb.state.fview)) + dwb_show_tab(dwb.state.fview); dwb_set_normal_message(dwb.state.fview, true, "Tagged group %d", n); } @@ -1278,9 +1278,11 @@ dwb_hide_tabbar(int *running) { void dwb_hide_tab(GList *gl) { + puts("hide tab"); } void dwb_show_tab(GList *gl) { + puts("show tab"); } /* dwb_focus_view(GList *gl){{{*/ @@ -112,6 +112,7 @@ #define BOOLEAN(X) (!(!(X))) #define NAVIGATION(X) ((Navigation*)((X)->data)) #define JS_CONTEXT_REF(X) (webkit_web_frame_get_global_context(webkit_web_view_get_main_frame(WEBVIEW(gl)))) +#define GROUP_VISIBLE(gl) (dwb.state.current_groups == 0 || (VIEW(gl)->status->group & dwb.state.current_groups)) #define CURRENT_URL() webkit_web_view_get_uri(CURRENT_WEBVIEW()) @@ -586,7 +587,7 @@ struct _State { gint last_tab; gboolean do_not_track; - guint currrent_groups; + guint current_groups; }; typedef enum _SettingsApply { |