mirror of
https://gitlab.com/sheaf/metabrush.git
synced 2024-11-27 09:24:08 +00:00
make stroke popover menu appear on right click
This commit is contained in:
parent
bcd0b9fb13
commit
3a7b05d60d
|
@ -360,7 +360,7 @@ To specify it in CSS, set the box-shadow of the contents node."
|
||||||
background-color: @bg;
|
background-color: @bg;
|
||||||
}
|
}
|
||||||
|
|
||||||
.metabrush .strokeMenu contents {
|
.metabrush .strokeMenu contents, .metabrush .strokeMenu arrow {
|
||||||
border: unset;
|
border: unset;
|
||||||
border-radius: 0px;
|
border-radius: 0px;
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
|
@ -594,7 +594,7 @@ To specify it in CSS, set the box-shadow of the contents node."
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Style when dragging layer item over the top part of an item */
|
/* Style when dragging layer item over the top part of an item */
|
||||||
.metabrush .dragging-item .drag-top.layer-item {
|
.dragging-item .drag-top.layer-item {
|
||||||
border-top: 2px solid @highlight;
|
border-top: 2px solid @highlight;
|
||||||
margin-top: -2px;
|
margin-top: -2px;
|
||||||
box-shadow:
|
box-shadow:
|
||||||
|
@ -602,7 +602,7 @@ To specify it in CSS, set the box-shadow of the contents node."
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Style when dragging layer item over the bottom part of an item */
|
/* Style when dragging layer item over the bottom part of an item */
|
||||||
.metabrush .dragging-item .drag-bot.layer-item {
|
.dragging-item .drag-bot.layer-item {
|
||||||
border-bottom: 2px solid @highlight;
|
border-bottom: 2px solid @highlight;
|
||||||
margin-bottom: -2px;
|
margin-bottom: -2px;
|
||||||
box-shadow:
|
box-shadow:
|
||||||
|
@ -610,7 +610,7 @@ To specify it in CSS, set the box-shadow of the contents node."
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Style when dragging brush over an item */
|
/* Style when dragging brush over an item */
|
||||||
.metabrush .dragging-brush .drag-top.layer-item, .dragging-brush .drag-bot.layer-item {
|
.dragging-brush .drag-top.layer-item, .dragging-brush .drag-bot.layer-item {
|
||||||
border-top: 2px solid @brushStroke;
|
border-top: 2px solid @brushStroke;
|
||||||
border-bottom: 2px solid @brushStroke;
|
border-bottom: 2px solid @brushStroke;
|
||||||
border-left: 0px;
|
border-left: 0px;
|
||||||
|
|
|
@ -178,8 +178,8 @@ strokeMenuDescription lay =
|
||||||
GroupLayer {} -> MenuItemDescription "Delete group" ( Nothing, DeleteLayer lay) Nothing
|
GroupLayer {} -> MenuItemDescription "Delete group" ( Nothing, DeleteLayer lay) Nothing
|
||||||
, Section ( Just "New group" ) $
|
, Section ( Just "New group" ) $
|
||||||
[ MenuItemDescription "...above" ( Nothing, NewGroup GroupAbove lay ) Nothing
|
[ MenuItemDescription "...above" ( Nothing, NewGroup GroupAbove lay ) Nothing
|
||||||
, MenuItemDescription "...below" ( Nothing, NewGroup GroupBelow lay ) Nothing
|
|
||||||
, MenuItemDescription "...containing" ( Nothing, NewGroup GroupContaining lay ) Nothing
|
, MenuItemDescription "...containing" ( Nothing, NewGroup GroupContaining lay ) Nothing
|
||||||
|
, MenuItemDescription "...below" ( Nothing, NewGroup GroupBelow lay ) Nothing
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -459,10 +459,16 @@ newLayerView uiElts@( UIElements { window } ) vars = mdo
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
click <- GTK.gestureClickNew
|
click <- GTK.gestureClickNew
|
||||||
|
GTK.gestureSingleSetButton click 0 -- listen to both left and right clicks
|
||||||
|
|
||||||
void $ GTK.onGestureClickPressed click $ \ clickNo x y -> do
|
void $ GTK.onGestureClickPressed click $ \ _nbClicks x y -> do
|
||||||
case clickNo of
|
button <- GTK.gestureSingleGetCurrentButton ?self
|
||||||
_ -> do
|
if -- | button <= 1 && nbClicks > 1
|
||||||
|
-- -> do GTK.editableSetEditable label True
|
||||||
|
-- GTK.editableLabelStartEditing label
|
||||||
|
-- void $ GTK.widgetGrabFocus label
|
||||||
|
| button == 3
|
||||||
|
-> do
|
||||||
GTK.widgetUnparent layerPopover
|
GTK.widgetUnparent layerPopover
|
||||||
GTK.widgetSetParent layerPopover expander
|
GTK.widgetSetParent layerPopover expander
|
||||||
layer <- getLayerData listItem
|
layer <- getLayerData listItem
|
||||||
|
@ -474,8 +480,8 @@ newLayerView uiElts@( UIElements { window } ) vars = mdo
|
||||||
GDK.setRectangleY rect ( round y )
|
GDK.setRectangleY rect ( round y )
|
||||||
GTK.popoverSetPointingTo layerPopover ( Just rect )
|
GTK.popoverSetPointingTo layerPopover ( Just rect )
|
||||||
GTK.popoverPopup layerPopover
|
GTK.popoverPopup layerPopover
|
||||||
|
| otherwise
|
||||||
_ -> return ()
|
-> return ()
|
||||||
|
|
||||||
----------------------------
|
----------------------------
|
||||||
-- Visibility CheckButton --
|
-- Visibility CheckButton --
|
||||||
|
|
Loading…
Reference in a new issue