From 4e027a2ec9458c46720cd6f84631613febb29e43 Mon Sep 17 00:00:00 2001 From: lisyarus Date: Fri, 26 Feb 2021 14:40:06 +0300 Subject: [PATCH] Add 'full' screen element mode --- libs/ui/include/psemek/ui/screen.hpp | 2 ++ libs/ui/source/screen.cpp | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/libs/ui/include/psemek/ui/screen.hpp b/libs/ui/include/psemek/ui/screen.hpp index 71f26281..55a04957 100644 --- a/libs/ui/include/psemek/ui/screen.hpp +++ b/libs/ui/include/psemek/ui/screen.hpp @@ -14,6 +14,7 @@ namespace psemek::ui left, center, right, + full, floating, }; @@ -22,6 +23,7 @@ namespace psemek::ui top, center, bottom, + full, floating, }; diff --git a/libs/ui/source/screen.cpp b/libs/ui/source/screen.cpp index ff92d941..348e69f8 100644 --- a/libs/ui/source/screen.cpp +++ b/libs/ui/source/screen.cpp @@ -49,6 +49,9 @@ namespace psemek::ui case x_policy::right: cbox[0] = {bbox[0].max - size[0], bbox[0].max}; break; + case x_policy::full: + cbox[0] = bbox[0]; + break; case x_policy::floating: cbox[0] = geom::expand(cbox[0], (size[0] - cbox[0].length()) / 2.f); @@ -70,6 +73,9 @@ namespace psemek::ui case y_policy::bottom: cbox[1] = {bbox[1].max - size[1], bbox[1].max}; break; + case y_policy::full: + cbox[1] = bbox[1]; + break; case y_policy::floating: cbox[1] = geom::expand(cbox[1], (size[1] - cbox[1].length()) / 2.f);