mirror of
https://github.com/labwc/labwc.git
synced 2026-02-11 04:27:51 -05:00
view: don't use bitset for VIEW_EDGE_ALL
We will use bitset for views snapped to corner (e.g. top-left = TOP|LEFT)
This commit is contained in:
parent
4b0ac0234c
commit
6441bd58f3
2 changed files with 10 additions and 6 deletions
|
|
@ -72,9 +72,7 @@ enum view_edge {
|
|||
VIEW_EDGE_UP = (1 << 2),
|
||||
VIEW_EDGE_DOWN = (1 << 3),
|
||||
VIEW_EDGE_CENTER = (1 << 4),
|
||||
|
||||
VIEW_EDGE_ALL = (VIEW_EDGE_LEFT | VIEW_EDGE_RIGHT |
|
||||
VIEW_EDGE_UP | VIEW_EDGE_DOWN | VIEW_EDGE_CENTER),
|
||||
VIEW_EDGE_ANY = (1 << 5),
|
||||
};
|
||||
|
||||
enum view_wants_focus {
|
||||
|
|
|
|||
12
src/view.c
12
src/view.c
|
|
@ -169,8 +169,14 @@ view_matches_query(struct view *view, struct view_query *query)
|
|||
return false;
|
||||
}
|
||||
|
||||
if (query->tiled != VIEW_EDGE_INVALID && !(query->tiled & view->tiled)) {
|
||||
return false;
|
||||
if (query->tiled == VIEW_EDGE_ANY) {
|
||||
if (!view->tiled) {
|
||||
return false;
|
||||
}
|
||||
} else if (query->tiled != VIEW_EDGE_INVALID) {
|
||||
if (query->tiled != view->tiled) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
const char *tiled_region =
|
||||
|
|
@ -2136,7 +2142,7 @@ view_edge_parse(const char *direction, bool tiled, bool any)
|
|||
|
||||
if (any) {
|
||||
if (!strcasecmp(direction, "any")) {
|
||||
return VIEW_EDGE_ALL;
|
||||
return VIEW_EDGE_ANY;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue