-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question about hiding brls::List
object form brls::TabFrame
#75
Comments
Hi, from the code you linked I assume you want to remove from the tab content, in your case an absolute layout. Do you need to hide it or remove it completely ? |
Hi, Thank you a lot for your help, I would like to remove/hide the SidebarItem from the brls::TabFrame (For testing only) I tried to override the addTab function to return its SidebarItem
Then, I tried the willDisappear and hide functions (on both the SidebarItem & the Tab View)
But unfortunately objects are just "no visible" and you can still interact with hidden object. I know that my tests are not conventional and I do not want to implement that kind of stuff in our project. |
Oh so you want to remove a tab, okay I see. That's another case of the "it should be in the library already but I never got to do it", the proper way is to add a method to TabFrame to remove tabs. The thing is, I don't think there is a way to get the "handle" of a tab to remove it later, so you might need to change the addTab method to return an iterator as a handle? Like how events subscriptions work. addTab returns the handle, and then you do removeTab by giving the handle. What are the other choices, by index ? Meh |
Hello, and modified the H0neyBadger@d028cda#diff-c688e1861d26b3147b14ad47322590850994e68d9dd14948b9e2684631dc8b88L42-R42 I also edited H0neyBadger@d028cda#diff-de0e0a79c58427c0efed51f2b749d605823dc0d536b4e61886e02754f9aed8b7R154-R165 unfortunately the focus remains on the current view. I have to change dpad direction to fully remove the item. What do you think, any suggestion ? (I will have a look to event subscription in order to find a better solution) |
Well the iterator solution removes the need for the whole "iterate over all decedent childes to update the position" logic. As for the focus problem, I think there is no universal solution, where do you think the focus should go? |
currently working on the "remove host" feature natinusala/borealis#75
Hi, unfortunately box_layout relies heavily on Indexes. the box_layout seems to "add" & "remove" child from the children list regularly. I'm taking a short break, before discovering that I'm wasting time on the wrong direction. I keep my experiment commit in a dirty state (with printf and glitches) if you want to have a look at it |
Hi, sorry for the delay I was on holiday, I am still catching up on things There is a pretty good example on how to use iterators there: https://github.com/natinusala/borealis/blob/master/library/include/borealis/event.hpp The advantage of using iterators is that they never become "obsolete", as you say. But that would indeed mean rewrite the entirety of BoxLayout to use iterators instead of indexes. So, seeing that it's a huge amount of work needed... may I ask, is that for chiaki? What UI elements and borealis features do you use in that homebrew? Could you share a screenshot? I am asking because I'm currently (on a break of) entirely rewriting the layout system of the library. I am slowly rewriting every component we had to the new system, and it takes time... but it solves the issue you are having, among others. I am saying that to see if you could consider switching to the new version, and maybe help me write what's left (it's a lot)? So far only AppletFrame, TabFrame, Label and Image are rewritten, but the new code is so, so much better. BoxLayout has been rewritten to allow alignment/gravity, padding, margins, absolute positioning... And there is an XML system to write the interfaces without writing code, exactly like Android. |
Hi no problems :-) . yes, that's for chiaki. (you have a screenshots in this issue, in a previous post)
yes, I m ok to move or contribute on another version ;-). the current chiaki design needs a refactor anyway. feel free to send me the link of your repo. I will have a look. |
Okay so I see that you are not using "advanced" features. I was planning on working on Button next, but I can do the ListItem family if you need it. Or if you want to help writing the new version, you can do ListItem yourself 😄 The code is here: https://github.com/natinusala/borealis/tree/yoga It's a big mess (just look at the TODO list in the scrolling box file 🤡 ) but it works, you can compile and run the demo to see for yourself (you might need to remove some WIP header code causing undefined references first 👀). The files of the demo are here, to give you an idea of what the new code looks like: There is very few C++ code, and that's on purpose 😏 |
I just tested it, and it looks pretty good ^^. diff --git a/library/lib/style.cpp b/library/lib/style.cpp
index 2e37766..6eb8e3a 100644
--- a/library/lib/style.cpp
+++ b/library/lib/style.cpp
@@ -19,7 +19,7 @@
*/
#include <borealis/style.hpp>
-
+#include <stdexcept>
namespace brls
{
diff --git a/library/lib/theme.cpp b/library/lib/theme.cpp
index ba3b68d..b77a9cb 100644
--- a/library/lib/theme.cpp
+++ b/library/lib/theme.cpp
@@ -18,7 +18,7 @@
*/
#include <borealis/theme.hpp>
-
+#include <stdexcept>
namespace brls
{
diff --git a/library/lib/view.cpp b/library/lib/view.cpp
index c8f1c3d..9325185 100644
--- a/library/lib/view.cpp
+++ b/library/lib/view.cpp
@@ -1649,6 +1649,7 @@ void View::registerCommonAttributes()
this->setBackgroundColor(value);
});
+ /*
this->registerColorXMLAttribute("borderColor", [this](NVGcolor value) {
this->setBorderColor(value);
});
@@ -1668,6 +1669,7 @@ void View::registerCommonAttributes()
{ "generic", ShadowType::GENERIC, },
{ "custom", ShadowType::CUSTOM, },
});
+ */
// Misc
BRLS_REGISTER_ENUM_XML_ATTRIBUTE(
diff --git a/meson.build b/meson.build
index d4cad3c..3ae659f 100644
--- a/meson.build
+++ b/meson.build
@@ -7,9 +7,7 @@ subdir('library')
demo_files = files(
'demo/main.cpp',
-
'demo/main_activity.cpp',
-
'demo/recycling_list_tab.cpp',
'demo/captioned_image.cpp',
) |
HI, can I close this issue? I am trying to tidy things up for the master branch which will become unsupported. |
Hi, yes you can. ;)
…On Sun, 7 Mar 2021, 21:33 Nathan S., ***@***.***> wrote:
HI, can I close this issue? I am trying to tidy things up for the master
branch which will become unsupported.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#75 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB3ZUM27U2TQGS6OVDQSQULTCPPJNANCNFSM4UWMNGNA>
.
|
Hello,
Is there a way to hide, close or delete a
brls::List
object formbrls::TabFrame
?like the opposite of the
addTab
function.As far as I can see it relies on private vector object. there is a lot of classes involve in this process and I do not want to take bad decision.
borealis/library/include/borealis/absolute_layout.hpp
Lines 37 to 39 in 205e97a
The text was updated successfully, but these errors were encountered: