Skip to content

Commit

Permalink
[C libgui] Ensure scroll views run an initial sizer
Browse files Browse the repository at this point in the history
  • Loading branch information
codyd51 committed Feb 7, 2024
1 parent 6e0c6f0 commit 5c97bf7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions programs/subprojects/libgui/gui_scroll_view.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ void gui_scroll_view_init(gui_scroll_view_t* view, gui_window_t* window, gui_win
(gui_window_resized_cb_t)_scrollbar_sizer
);
view->scrollbar->scroll_position_updated_cb = (gui_scrollbar_updated_cb_t)_scrollbar_position_updated;

_scroll_view_window_resized(view, window->size);
}

void gui_scroll_view_add_subview(gui_view_t* superview, gui_scroll_view_t* subview) {
Expand Down
2 changes: 2 additions & 0 deletions programs/subprojects/libgui/gui_view.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ void gui_view_set_title(gui_view_t* v, char* title) {

if (title != NULL) {
v->_title = strdup(title);
//v->title_bar_height = max(10, v->frame.size.height / 14);
v->title_bar_height = 14;
// View title
v->_title_inset.size = size_make(
v->frame.size.width,
Expand Down

0 comments on commit 5c97bf7

Please sign in to comment.