From 2497569132eadf9649df8e6697a99b926c93c20d Mon Sep 17 00:00:00 2001 From: Jaidyn Ann Date: Fri, 12 Mar 2021 19:27:44 -0600 Subject: [PATCH] Improve window scalability --- TODO.txt | 9 +++------ src/EntriesView.cpp | 4 +--- src/MainWindow.cpp | 14 +++++++++++--- src/UpdatesView.cpp | 3 +-- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/TODO.txt b/TODO.txt index 3aaed7b..d884e03 100644 --- a/TODO.txt +++ b/TODO.txt @@ -5,14 +5,11 @@ Important Features: Important improvements: * Memory leaks - * ~.05MB per feed on download (+2MB w 40 feeds) - * This leak is in Util.ccp, fetch(). I'm stumped here. - * ~.02MB per feed on parsing (+1MB w 40 feeds) + * ~.05MB per feed on download, in Util.ccp, fetch(). I'm stumped here. + * ~.02MB per feed on parsing * Fix background of Feeds List error status icon (it's black, not transparent) -* Make UI friendly to whatever font-size you throw at it - * Give a max size to the progress label in FeedsView * Make fancy Markdown README -* Make an icon, somehow (idk I'm not an artist) +* Make an icon(idk I'm not an artist) Nice Improvements: diff --git a/src/EntriesView.cpp b/src/EntriesView.cpp index ca6c72d..8dfcbd6 100644 --- a/src/EntriesView.cpp +++ b/src/EntriesView.cpp @@ -174,7 +174,6 @@ EntriesView::_InitInterface() _PopulateOpenWithMenu(); - BLayoutBuilder::Group<>(fSavingBox, B_HORIZONTAL) .SetInsets(B_USE_ITEM_INSETS) .AddGroup(B_VERTICAL, B_USE_DEFAULT_SPACING) @@ -211,10 +210,9 @@ EntriesView::_InitInterface() .End() .End(); - BLayoutBuilder::Group<>(this, B_VERTICAL, 0) + BLayoutBuilder::Group<>(this, B_VERTICAL, B_USE_ITEM_SPACING) .SetInsets(B_USE_DEFAULT_SPACING) .Add(fSavingBox) - .AddGlue() .Add(fOpeningBox) .AddGlue() .End(); diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index d720138..aedbc23 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -26,7 +26,7 @@ MainWindow::MainWindow() : BWindow(((App*)be_app)->fPreferences->fMainWindowRect, "Pogger", - B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE) + B_TITLED_WINDOW, NULL) { _InitInterface(); MoveOnScreen(); @@ -104,13 +104,21 @@ MainWindow::_InitInterface() // Bottom bar fStatusBar = new BStatusBar("feedProgress"); - fUpdateNowButton = new BButton("updateNow", "Update Now", new BMessage(kUpdateSubscribed)); fUpdateNowButton->SetTarget((App*)be_app); fUpdateNowButton->SetExplicitAlignment( BAlignment(B_ALIGN_RIGHT, B_ALIGN_MIDDLE)); + // Window size + font_height fontHeight; + fTabView->GetFontHeight(&fontHeight); + int16 fsize = fontHeight.ascent + fontHeight.descent; + float minWidth = 36 * fsize; + float minHeight = 25 * fsize; + SetSizeLimits(minWidth, 100000, minHeight, 100000); + if (Size().Height() < minHeight || Size().Width() < minWidth) + ResizeTo(minWidth, minHeight); BLayoutBuilder::Group<>(this, B_VERTICAL, 0) .SetInsets(0, B_USE_DEFAULT_SPACING, 0, 0) @@ -122,7 +130,7 @@ MainWindow::_InitInterface() .SetInsets(B_USE_WINDOW_SPACING, B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING, B_USE_WINDOW_SPACING) .End() - .End(); + .End(); } diff --git a/src/UpdatesView.cpp b/src/UpdatesView.cpp index afe9934..a514021 100644 --- a/src/UpdatesView.cpp +++ b/src/UpdatesView.cpp @@ -118,10 +118,9 @@ UpdatesView::_InitInterface() .Add(fIntervalSlider) .End(); - BLayoutBuilder::Group<>(this, B_VERTICAL, 0) + BLayoutBuilder::Group<>(this, B_VERTICAL, B_USE_ITEM_SPACING) .SetInsets(B_USE_DEFAULT_SPACING) .Add(fNotificationsBox) - .AddGlue() .Add(fSchedulingBox) .AddGlue() .End();