# Changes 0.2.7
- Add UI7 32Bit Version Num - Fix ClipRect Bug with Separators - Fix Triangle/Rect Render order Bug (UI7 - Bug of Lithium) - Add Position to Menus and Movement by dragging the Title bar - Add Menu Collabse (+ Flag to disable) - Add About and Metrics Menus to Context
This commit is contained in:
@ -36,6 +36,8 @@ enum UI7MenuFlags_ {
|
||||
UI7MenuFlags_HzScrolling = 1 << 2, ///< Enable Horizontal Scrolling
|
||||
UI7MenuFlags_VtScrolling = 1 << 3, ///< Enable Vertical Scrolling
|
||||
UI7MenuFlags_NoBackground = 1 << 4, ///< Dont Render Menu Background
|
||||
UI7MenuFlags_NoClipRect = 1 << 5, ///< Disable clip render area of the Menu
|
||||
UI7MenuFlags_NoCollapse = 1 << 6, ///< Disable Menu Collapse
|
||||
// Enable Horizontal and Vertical Scrolling
|
||||
UI7MenuFlags_Scrolling = UI7MenuFlags_HzScrolling | UI7MenuFlags_VtScrolling,
|
||||
};
|
||||
|
@ -158,7 +158,7 @@ class Menu : public SmartCtor<Menu> {
|
||||
* Get the Cursor Position
|
||||
* @return Cursor Pos
|
||||
*/
|
||||
vec2 Cursor() const { return cursor; }
|
||||
vec2 Cursor() const { return pos + cursor; }
|
||||
/**
|
||||
* Set the Cursor position
|
||||
* @note The old Position can be restored with RestoreCursor
|
||||
@ -268,8 +268,12 @@ class Menu : public SmartCtor<Menu> {
|
||||
|
||||
// Advanced
|
||||
|
||||
/** Display Debug Labels of the Menu */
|
||||
void DebugLabels();
|
||||
/**
|
||||
* Display Debug Labels of a Menu
|
||||
* @param m Menu to display Data from
|
||||
* @param t Target to Write the Labels into
|
||||
*/
|
||||
static void DebugLabels(Menu::Ref m, Menu::Ref t = nullptr);
|
||||
|
||||
// Uneditable Stuff
|
||||
|
||||
@ -352,6 +356,7 @@ class Menu : public SmartCtor<Menu> {
|
||||
bool scrollbar[2]; ///< Is Hz or Vt Scrollbar rendered
|
||||
bool scroll_allowed[2]; ///< Is Hz or Vt Scrolling Alowed
|
||||
bool has_touch; ///< Menu has touch (depends on screen)
|
||||
bool is_open = true; ///< For Collapse Event
|
||||
|
||||
Container::Ref tmp_parent; ///< Parent Container (for better alignment etc)
|
||||
|
||||
@ -373,6 +378,7 @@ class Menu : public SmartCtor<Menu> {
|
||||
vec2 mouse; ///< Mouse/Touch Position
|
||||
vec2 bslpos; ///< Before Sameline Position
|
||||
vec2 last_size; ///< Last Object Size
|
||||
vec2 pos; ///< Menu Position
|
||||
|
||||
// Theme
|
||||
Theme::Ref theme;
|
||||
|
@ -23,15 +23,29 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <pd/core/timetrace.hpp>
|
||||
#include <pd/drivers/hid.hpp>
|
||||
#include <pd/ui7/drawlist.hpp>
|
||||
#include <pd/ui7/flags.hpp>
|
||||
#include <pd/ui7/id.hpp>
|
||||
#include <pd/ui7/menu.hpp>
|
||||
#include <pd/ui7/theme.hpp>
|
||||
/**
|
||||
* Declare UI7 Version
|
||||
* Format: 00 00 00 00
|
||||
* Major Minor Patch Build
|
||||
* 0x01010000 -> 1.1.0-0
|
||||
*/
|
||||
#define UI7_VERSION 0x00020700
|
||||
|
||||
namespace PD {
|
||||
namespace UI7 {
|
||||
/**
|
||||
* Get UI7 Version String
|
||||
* @param show_build Ahow build num (mostly unused)
|
||||
* @return Version String (1.0.0-1 for example)
|
||||
*/
|
||||
std::string GetVersion(bool show_build = false);
|
||||
/** Base Context for UI7 */
|
||||
class Context : public SmartCtor<Context> {
|
||||
public:
|
||||
@ -48,6 +62,7 @@ class Context : public SmartCtor<Context> {
|
||||
theme = Theme::New();
|
||||
back = DrawList::New(ren);
|
||||
front = DrawList::New(ren);
|
||||
s_delta = TimeStats::New(60);
|
||||
}
|
||||
~Context() = default;
|
||||
|
||||
@ -110,6 +125,14 @@ class Context : public SmartCtor<Context> {
|
||||
/** Get the Root Layer of the Menu */
|
||||
int RootLayer() const { return root_layer; }
|
||||
|
||||
// Debugging / Demo / About
|
||||
|
||||
/** About Menu */
|
||||
void AboutMenu();
|
||||
|
||||
/** Metrics */
|
||||
void MetricsMenu();
|
||||
|
||||
private:
|
||||
// Used in Overlays
|
||||
int root_layer = 0;
|
||||
@ -139,6 +162,11 @@ class Context : public SmartCtor<Context> {
|
||||
DrawList::Ref back;
|
||||
// Active Theme
|
||||
Theme::Ref theme;
|
||||
|
||||
// Metrics
|
||||
|
||||
// Deltatime Average
|
||||
TimeStats::Ref s_delta;
|
||||
};
|
||||
} // namespace UI7
|
||||
} // namespace PD
|
Reference in New Issue
Block a user