Skip to content

Commit

Permalink
Fix SimplyWindow to have status_bar_insets_bottom only for round (Add…
Browse files Browse the repository at this point in the history
…resses pebble#139)
  • Loading branch information
Meiguro committed Feb 14, 2016
1 parent 6996a55 commit 5d8b9bd
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ main.on('click', 'up', function(e) {
}, {
title: 'Second Item',
subtitle: 'Subtitle Text'
}, {
title: 'Third Item',
}, {
title: 'Fourth Item',
}]
}]
});
Expand Down
2 changes: 2 additions & 0 deletions src/simply/simply_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,9 @@ SimplyMenu *simply_menu_create(Simply *simply) {
SimplyMenu *self = malloc(sizeof(*self));
*self = (SimplyMenu) {
.window.simply = simply,
#if defined(PBL_ROUND)
.window.status_bar_insets_bottom = true,
#endif
.menu_layer.num_sections = 1,
};

Expand Down
2 changes: 2 additions & 0 deletions src/simply/simply_window.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,10 @@ static void prv_update_layer_placement(SimplyWindow *self) {
if (has_status_bar) {
GRect status_frame = { .size = { frame.size.w, STATUS_BAR_LAYER_HEIGHT } };
frame.origin.y = STATUS_BAR_LAYER_HEIGHT;
#if defined(PBL_ROUND)
frame.size.h -= self->status_bar_insets_bottom ? STATUS_BAR_LAYER_HEIGHT * 2 :
STATUS_BAR_LAYER_HEIGHT;
#endif
if (has_action_bar) {
status_frame.size.w -= ACTION_BAR_WIDTH;
}
Expand Down
4 changes: 3 additions & 1 deletion src/simply/simply_window.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ struct SimplyWindow {
GColor8 background_color;
bool is_scrollable:1;
bool use_status_bar:1;
bool status_bar_insets_bottom:1;
bool use_action_bar:1;
#if defined(PBL_ROUND)
bool status_bar_insets_bottom:1;
#endif
};

SimplyWindow *simply_window_init(SimplyWindow *self, Simply *simply);
Expand Down

0 comments on commit 5d8b9bd

Please sign in to comment.