# Changes 0.2.8
- Fix Flickering problem in StaticText api - Fix Lagacy and Container HandleScrolling InBox checks - Add IO Flags define for future - Implement Single Object Dragging API by IO Context - Add TreeNodes - Use ioMenuPadding and ItemSpace - Add StyleEditorMenu - Rework ContainerApi to take functions from IO and add an Update function template for Updating internal values if required - Use new DragApi for MenuCollabse, MenuDragging, MenuResize, SliderDragging and TreeNodes Open/Close - Add Helper Defines for Metrics Menu [INTERNAL] - Add TimeTrace as Tree to Metrics as well as other new Data - Add GetRawObject to StaticText for custom rendering like ui7 - Add DrawlistRegestry to correctly render Menus in their own layer ranges
This commit is contained in:
		| @@ -24,6 +24,7 @@ SOFTWARE. | ||||
|  */ | ||||
|  | ||||
| #include <pd/ui7/container/container.hpp> | ||||
| #include <pd/ui7/io.hpp> | ||||
|  | ||||
| namespace PD { | ||||
| namespace UI7 { | ||||
| @@ -42,13 +43,9 @@ class Button : public Container { | ||||
|    * @param pos Base Position | ||||
|    * @param lr Reference to the Renderer | ||||
|    */ | ||||
|   Button(const std::string& label, vec2 pos, LI::Renderer::Ref lr) { | ||||
|     this->screen = lr->CurrentScreen(); | ||||
|   Button(const std::string& label, UI7::IO::Ref io) { | ||||
|     this->label = label; | ||||
|     this->SetPos(pos); | ||||
|     this->tdim = lr->GetTextDimensions(label); | ||||
|     color = UI7Color_Button; | ||||
|     this->SetSize(tdim + vec2(8, 4)); | ||||
|     this->tdim = io->Ren->GetTextDimensions(label); | ||||
|   } | ||||
|   ~Button() = default; | ||||
|  | ||||
| @@ -66,11 +63,14 @@ class Button : public Container { | ||||
|    * */ | ||||
|   void Draw() override; | ||||
|  | ||||
|   /** Function to Update Size if framepadding changes */ | ||||
|   void Update() override; | ||||
|  | ||||
|  private: | ||||
|   vec2 tdim;             ///< Text size | ||||
|   UI7Color color;        ///< current button color | ||||
|   std::string label;     ///< Label of the Button | ||||
|   bool pressed = false;  ///< ispressed value | ||||
|   vec2 tdim;                         ///< Text size | ||||
|   UI7Color color = UI7Color_Button;  ///< current button color | ||||
|   std::string label;                 ///< Label of the Button | ||||
|   bool pressed = false;              ///< ispressed value | ||||
| }; | ||||
| }  // namespace UI7 | ||||
| }  // namespace PD | ||||
		Reference in New Issue
	
	Block a user