mirror of
https://github.com/labwc/labwc.git
synced 2025-11-04 13:30:07 -05:00
implement corner/edge mouse contexts
This commit is contained in:
parent
2ce961a0bd
commit
5ee4baee7a
2 changed files with 34 additions and 4 deletions
|
|
@ -57,14 +57,32 @@ mousebind_event_from_str(const char *str)
|
||||||
static enum ssd_part_type
|
static enum ssd_part_type
|
||||||
context_from_str(const char *str)
|
context_from_str(const char *str)
|
||||||
{
|
{
|
||||||
if (!strcasecmp(str, "Titlebar")) {
|
if (!strcasecmp(str, "Close")) {
|
||||||
return LAB_SSD_PART_TITLEBAR;
|
|
||||||
} else if (!strcasecmp(str, "Close")) {
|
|
||||||
return LAB_SSD_BUTTON_CLOSE;
|
return LAB_SSD_BUTTON_CLOSE;
|
||||||
} else if (!strcasecmp(str, "Maximize")) {
|
} else if (!strcasecmp(str, "Maximize")) {
|
||||||
return LAB_SSD_BUTTON_MAXIMIZE;
|
return LAB_SSD_BUTTON_MAXIMIZE;
|
||||||
} else if (!strcasecmp(str, "Iconify")) {
|
} else if (!strcasecmp(str, "Iconify")) {
|
||||||
return LAB_SSD_BUTTON_ICONIFY;
|
return LAB_SSD_BUTTON_ICONIFY;
|
||||||
|
} else if (!strcasecmp(str, "Titlebar")) {
|
||||||
|
return LAB_SSD_PART_TITLEBAR;
|
||||||
|
} else if (!strcasecmp(str, "Title")) {
|
||||||
|
return LAB_SSD_PART_TITLE;
|
||||||
|
} else if (!strcasecmp(str, "TLCorner")) {
|
||||||
|
return LAB_SSD_PART_CORNER_TOP_LEFT;
|
||||||
|
} else if (!strcasecmp(str, "TRCorner")) {
|
||||||
|
return LAB_SSD_PART_CORNER_TOP_RIGHT;
|
||||||
|
} else if (!strcasecmp(str, "BRCorner")) {
|
||||||
|
return LAB_SSD_PART_CORNER_BOTTOM_RIGHT;
|
||||||
|
} else if (!strcasecmp(str, "BLCorner")) {
|
||||||
|
return LAB_SSD_PART_CORNER_BOTTOM_LEFT;
|
||||||
|
} else if (!strcasecmp(str, "Top")) {
|
||||||
|
return LAB_SSD_PART_TOP;
|
||||||
|
} else if (!strcasecmp(str, "Right")) {
|
||||||
|
return LAB_SSD_PART_RIGHT;
|
||||||
|
} else if (!strcasecmp(str, "Bottom")) {
|
||||||
|
return LAB_SSD_PART_BOTTOM;
|
||||||
|
} else if (!strcasecmp(str, "Left")) {
|
||||||
|
return LAB_SSD_PART_LEFT;
|
||||||
} else if (!strcasecmp(str, "Frame")) {
|
} else if (!strcasecmp(str, "Frame")) {
|
||||||
return LAB_SSD_FRAME;
|
return LAB_SSD_FRAME;
|
||||||
} else if (!strcasecmp(str, "Client")) {
|
} else if (!strcasecmp(str, "Client")) {
|
||||||
|
|
|
||||||
14
src/ssd.c
14
src/ssd.c
|
|
@ -423,10 +423,22 @@ ssd_part_contains(enum ssd_part_type whole, enum ssd_part_type candidate)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (whole == LAB_SSD_PART_TITLEBAR) {
|
if (whole == LAB_SSD_PART_TITLEBAR) {
|
||||||
return candidate >= LAB_SSD_BUTTON_CLOSE && candidate <= LAB_SSD_PART_CORNER_TOP_RIGHT;
|
return candidate >= LAB_SSD_BUTTON_CLOSE && candidate <= LAB_SSD_PART_TITLE;
|
||||||
}
|
}
|
||||||
if (whole == LAB_SSD_FRAME) {
|
if (whole == LAB_SSD_FRAME) {
|
||||||
return candidate >= LAB_SSD_BUTTON_CLOSE && candidate <= LAB_SSD_CLIENT;
|
return candidate >= LAB_SSD_BUTTON_CLOSE && candidate <= LAB_SSD_CLIENT;
|
||||||
}
|
}
|
||||||
|
if (whole == LAB_SSD_PART_TOP) {
|
||||||
|
return candidate == LAB_SSD_PART_CORNER_TOP_LEFT || candidate == LAB_SSD_PART_CORNER_BOTTOM_LEFT;
|
||||||
|
}
|
||||||
|
if (whole == LAB_SSD_PART_RIGHT) {
|
||||||
|
return candidate == LAB_SSD_PART_CORNER_TOP_RIGHT || candidate == LAB_SSD_PART_CORNER_BOTTOM_RIGHT;
|
||||||
|
}
|
||||||
|
if (whole == LAB_SSD_PART_BOTTOM) {
|
||||||
|
return candidate == LAB_SSD_PART_CORNER_BOTTOM_RIGHT || candidate == LAB_SSD_PART_CORNER_BOTTOM_LEFT;
|
||||||
|
}
|
||||||
|
if (whole == LAB_SSD_PART_LEFT) {
|
||||||
|
return candidate == LAB_SSD_PART_CORNER_TOP_LEFT || candidate == LAB_SSD_PART_CORNER_BOTTOM_LEFT;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue