From 2c812a6b7a0b24b9012379118867fb4f64f32c14 Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Wed, 13 Nov 2019 21:09:21 +0100 Subject: GUI: Add DropdownButtonWidget and use it in the launcher for mass add DropdownButtonWidget is a button split in two parts vertically. Clicking the left part triggers a default action. Clicking the right part shows a list of other actions the user can choose from. Using this widget on the launcher lets 'Mass add' be a secondary action of the 'Add' button, removing the necessity of pressing the shift key to access the feature. --- graphics/VectorRenderer.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'graphics/VectorRenderer.h') diff --git a/graphics/VectorRenderer.h b/graphics/VectorRenderer.h index 9be55460c2..28a987a927 100644 --- a/graphics/VectorRenderer.h +++ b/graphics/VectorRenderer.h @@ -64,6 +64,7 @@ struct DrawStep { negative values mean counting from the opposite direction */ Common::Rect padding; + Common::Rect clip; /**< Clipping rect restriction */ enum VectorAlignment { kVectorAlignManual, @@ -391,6 +392,11 @@ public: */ int stepGetRadius(const DrawStep &step, const Common::Rect &area); + /** + * Restrict a draw call clipping rect with a step specific clipping rect + */ + Common::Rect applyStepClippingRect(const Common::Rect &area, const Common::Rect &clip, const DrawStep &step); + /** * DrawStep callback functions for each drawing feature */ @@ -412,7 +418,7 @@ public: void drawCallback_LINE(const Common::Rect &area, const DrawStep &step) { uint16 x, y, w, h; stepGetPositions(step, area, x, y, w, h); - drawLine(x, y, x + w, y + w); + drawLine(x, y, x + w, y + h); } void drawCallback_ROUNDSQ(const Common::Rect &area, const DrawStep &step) { -- cgit v1.2.3