HaikuArchives / StreamRadio

Haiku-native application to search for and listen to internet radio stations.
8 stars 11 forks source link

GUI: Switch to BSplitView and remove the Expander class #30

Closed CodeforEvolution closed 4 years ago

CodeforEvolution commented 4 years ago

Here we are, I also added some nice insets to the main window to give the some breathing room for the widgets! :)

CodeforEvolution commented 4 years ago

@Vidrep, could you test this to see if it fixes your ticket? (#28)

humdingerb commented 4 years ago

Nice!

I have two suggestions to get rid of a bit of unneeded vertical padding:

+++ b/MainWindow.cpp
@@ -88,8 +88,8 @@ MainWindow::MainWindow()
        BLayoutBuilder::Group<>(this, B_VERTICAL)
                .Add(fMainMenu)
                .AddGroup(B_VERTICAL)
-                       .SetInsets(B_USE_WINDOW_INSETS)
-                       .AddSplit(B_VERTICAL)
+                       .SetInsets(B_USE_WINDOW_INSETS, 0, B_USE_WINDOW_INSETS, B_USE_WINDOW_INSETS)
+                       .AddSplit(B_VERTICAL, 2)
                                .Add(stationScroll)
                                .Add(fStationPanel)
                                .SetCollapsible(1, true)

And in StationPanel.cpp:

-       BLayoutBuilder::Grid<>(this, 7, 3)
-               .SetInsets(B_USE_SMALL_INSETS)
-               .SetSpacing(B_USE_ITEM_SPACING, B_USE_SMALL_SPACING)
-               .Add(fLogo, 0, 0, 1, 3)
+       BLayoutBuilder::Grid<>(this, B_USE_SMALL_INSETS, B_USE_SMALL_INSETS)
+               .Add(fLogo, 0, 0, 1, 4)
                .AddTextControl(fName, 1, 0, B_ALIGN_LEFT)
                .AddTextControl(fGenre, 3, 0, B_ALIGN_RIGHT, 1, 2)
                .AddTextControl(fUrl, 1, 1, B_ALIGN_LEFT, 1, 4)
                .AddTextControl(fStationUrl, 1, 2, B_ALIGN_LEFT, 1, 3)
                .Add(fVisitStation, 5, 2)
                .Add(fVolume, 6, 0, 1, 3)
+               .AddGlue(1, 3, 5, 1)
        .End();

This is the current window.

This with the above change

Vidrep commented 4 years ago

No expander, no crash

CodeforEvolution commented 4 years ago

Here we are!

humdingerb commented 4 years ago

Thanks very much!