Skip to content

Commit

Permalink
Don't reset the scroll layer if it is not being used
Browse files Browse the repository at this point in the history
SimplyMenu does not use the scroll layer, therefore resetting the scroll
layer will break SimplyMenu scrolling due to the scroll layer taking
over the click config. Add a SimplyWindow boolean property that
explicitly specifies whether the scroll layer is used in order to avoid
resetting and applying the scroll layer click config if it is not used.
  • Loading branch information
Meiguro committed Feb 27, 2016
1 parent 2ad75b8 commit c3c6b9c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/simply/simply_stage.c
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,7 @@ static void window_load(Window *window) {
*(void**) layer_get_data(layer) = self;
layer_set_update_proc(layer, layer_update_callback);
scroll_layer_add_child(self->window.scroll_layer, layer);
self->window.use_scroll_layer = true;
}

static void window_appear(Window *window) {
Expand Down
1 change: 1 addition & 0 deletions src/simply/simply_ui.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ static void window_load(Window *window) {
*(void**) layer_get_data(layer) = self;
layer_set_update_proc(layer, layer_update_callback);
scroll_layer_add_child(self->window.scroll_layer, layer);
self->window.use_scroll_layer = true;

simply_ui_set_style(self, 1);
}
Expand Down
2 changes: 1 addition & 1 deletion src/simply/simply_window.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ static void prv_set_scroll_layer_click_config(SimplyWindow *self) {

void simply_window_set_scrollable(SimplyWindow *self, bool is_scrollable, bool animated,
bool reset) {
if (self->is_scrollable == is_scrollable && !reset) { return; }
if (!self->use_scroll_layer || (self->is_scrollable == is_scrollable && !reset)) { return; }

self->is_scrollable = is_scrollable;

Expand Down
1 change: 1 addition & 0 deletions src/simply/simply_window.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ struct SimplyWindow {
ButtonId button_mask:4;
GColor8 background_color;
bool is_scrollable:1;
bool use_scroll_layer:1;
bool use_status_bar:1;
bool use_action_bar:1;
#if defined(PBL_ROUND)
Expand Down

0 comments on commit c3c6b9c

Please sign in to comment.