summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorportix <none@none>2012-07-29 20:41:46 +0200
committerportix <none@none>2012-07-29 20:41:46 +0200
commit6eebbc1778f12e6c6a7fc2b016431bd166c73be0 (patch)
tree9cd135af6c07c8fb570bbc7eeb0b53a3f12ce568 /src
parentd4dafeb62ca99abe224e98612744f93e0e60572d (diff)
downloaddwb-6eebbc1778f12e6c6a7fc2b016431bd166c73be0.zip
Using GROUP_VISIBLE makro
Diffstat (limited to 'src')
-rw-r--r--src/commands.c11
-rw-r--r--src/dwb.c2
-rw-r--r--src/dwb.h3
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);
}
diff --git a/src/dwb.c b/src/dwb.c
index 4fc9ed56..523843d3 100644
--- a/src/dwb.c
+++ b/src/dwb.c
@@ -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){{{*/
diff --git a/src/dwb.h b/src/dwb.h
index 17c112c9..a7182981 100644
--- a/src/dwb.h
+++ b/src/dwb.h
@@ -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 {