Skip to content

Commit

Permalink
ozone: fix alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
natinusala committed Feb 13, 2019
1 parent 68e5431 commit 59398e4
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 46 deletions.
40 changes: 20 additions & 20 deletions menu/drivers/ozone/ozone.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,11 +345,11 @@ static void ozone_context_reset(void *data, bool is_threaded)
ozone->has_all_assets = true;

fill_pathname_join(font_path, ozone->assets_path, "regular.ttf", sizeof(font_path));
ozone->fonts.footer = menu_display_font_file(font_path, FONT_SIZE_FOOTER, is_threaded);
ozone->fonts.entries_label = menu_display_font_file(font_path, FONT_SIZE_ENTRIES_LABEL, is_threaded);
ozone->fonts.footer = menu_display_font_file(font_path, FONT_SIZE_FOOTER, is_threaded);
ozone->fonts.entries_label = menu_display_font_file(font_path, FONT_SIZE_ENTRIES_LABEL, is_threaded);
ozone->fonts.entries_sublabel = menu_display_font_file(font_path, FONT_SIZE_ENTRIES_SUBLABEL, is_threaded);
ozone->fonts.time = menu_display_font_file(font_path, FONT_SIZE_TIME, is_threaded);
ozone->fonts.sidebar = menu_display_font_file(font_path, FONT_SIZE_SIDEBAR, is_threaded);
ozone->fonts.time = menu_display_font_file(font_path, FONT_SIZE_TIME, is_threaded);
ozone->fonts.sidebar = menu_display_font_file(font_path, FONT_SIZE_SIDEBAR, is_threaded);

fill_pathname_join(font_path, ozone->assets_path, "bold.ttf", sizeof(font_path));
ozone->fonts.title = menu_display_font_file(font_path, FONT_SIZE_TITLE, is_threaded);
Expand All @@ -372,27 +372,27 @@ static void ozone_context_reset(void *data, bool is_threaded)

ozone->dimensions.entry_padding_horizontal_half = ENTRY_PADDING_HORIZONTAL_HALF * scale;
ozone->dimensions.entry_padding_horizontal_full = ENTRY_PADDING_HORIZONTAL_FULL * scale;
ozone->dimensions.entry_padding_vertical = ENTRY_PADDING_VERTICAL * scale;
ozone->dimensions.entry_height = ENTRY_HEIGHT * scale;
ozone->dimensions.entry_spacing = ENTRY_SPACING * scale;
ozone->dimensions.entry_icon_size = ENTRY_ICON_SIZE * scale;
ozone->dimensions.entry_icon_padding = ENTRY_ICON_PADDING * scale;

ozone->dimensions.sidebar_width = SIDEBAR_WIDTH * scale;
ozone->dimensions.sidebar_entry_height = SIDEBAR_ENTRY_HEIGHT * scale;
ozone->dimensions.sidebar_padding_horizontal = SIDEBAR_X_PADDING * scale;
ozone->dimensions.sidebar_padding_vertical = SIDEBAR_Y_PADDING * scale;
ozone->dimensions.sidebar_entry_padding_vertical = SIDEBAR_ENTRY_Y_PADDING * scale;
ozone->dimensions.sidebar_entry_icon_size = SIDEBAR_ENTRY_ICON_SIZE * scale;
ozone->dimensions.sidebar_entry_icon_padding = SIDEBAR_ENTRY_ICON_PADDING * scale;
ozone->dimensions.entry_padding_vertical = ENTRY_PADDING_VERTICAL * scale;
ozone->dimensions.entry_height = ENTRY_HEIGHT * scale;
ozone->dimensions.entry_spacing = ENTRY_SPACING * scale;
ozone->dimensions.entry_icon_size = ENTRY_ICON_SIZE * scale;
ozone->dimensions.entry_icon_padding = ENTRY_ICON_PADDING * scale;

ozone->dimensions.sidebar_width = SIDEBAR_WIDTH * scale;
ozone->dimensions.sidebar_entry_height = SIDEBAR_ENTRY_HEIGHT * scale;
ozone->dimensions.sidebar_padding_horizontal = SIDEBAR_X_PADDING * scale;
ozone->dimensions.sidebar_padding_vertical = SIDEBAR_Y_PADDING * scale;
ozone->dimensions.sidebar_entry_padding_vertical = SIDEBAR_ENTRY_Y_PADDING * scale;
ozone->dimensions.sidebar_entry_icon_size = SIDEBAR_ENTRY_ICON_SIZE * scale;
ozone->dimensions.sidebar_entry_icon_padding = SIDEBAR_ENTRY_ICON_PADDING * scale;

ozone->dimensions.cursor_size = CURSOR_SIZE * scale;

/* Naive font size */
ozone->title_font_glyph_width = FONT_SIZE_TITLE * 3/4;
ozone->entry_font_glyph_width = FONT_SIZE_ENTRIES_LABEL * 3/4;
ozone->title_font_glyph_width = FONT_SIZE_TITLE * 3/4;
ozone->entry_font_glyph_width = FONT_SIZE_ENTRIES_LABEL * 3/4;
ozone->sublabel_font_glyph_width = FONT_SIZE_ENTRIES_SUBLABEL * 3/4;
ozone->sidebar_font_glyph_width = FONT_SIZE_SIDEBAR * 3/4;
ozone->sidebar_font_glyph_width = FONT_SIZE_SIDEBAR * 3/4;

/* More realistic font size */
size = font_driver_get_message_width(ozone->fonts.title, "a", 1, 1);
Expand Down
52 changes: 26 additions & 26 deletions menu/drivers/ozone/ozone.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,40 +29,40 @@ typedef struct ozone_handle ozone_handle_t;

#define OZONE_ENABLE_MOUSE 0 /* TODO: remove this define once it works */

#define ANIMATION_PUSH_ENTRY_DURATION 10
#define ANIMATION_CURSOR_DURATION 8
#define ANIMATION_CURSOR_PULSE 30
#define ANIMATION_PUSH_ENTRY_DURATION 10
#define ANIMATION_CURSOR_DURATION 8
#define ANIMATION_CURSOR_PULSE 30

#define FONT_SIZE_FOOTER 18
#define FONT_SIZE_TITLE 36
#define FONT_SIZE_TIME 22
#define FONT_SIZE_ENTRIES_LABEL 24
#define FONT_SIZE_ENTRIES_SUBLABEL 18
#define FONT_SIZE_SIDEBAR 24
#define FONT_SIZE_FOOTER 18
#define FONT_SIZE_TITLE 36
#define FONT_SIZE_TIME 22
#define FONT_SIZE_ENTRIES_LABEL 24
#define FONT_SIZE_ENTRIES_SUBLABEL 18
#define FONT_SIZE_SIDEBAR 24

#define HEADER_HEIGHT 87
#define FOOTER_HEIGHT 78

#define ENTRY_PADDING_HORIZONTAL_HALF 60
#define ENTRY_PADDING_HORIZONTAL_FULL 150
#define ENTRY_PADDING_VERTICAL 20
#define ENTRY_HEIGHT 50
#define ENTRY_SPACING 8
#define ENTRY_ICON_SIZE 46
#define ENTRY_ICON_PADDING 15

#define SIDEBAR_WIDTH 408
#define SIDEBAR_X_PADDING 40
#define SIDEBAR_Y_PADDING 20
#define SIDEBAR_ENTRY_HEIGHT 50
#define SIDEBAR_ENTRY_Y_PADDING 10
#define SIDEBAR_ENTRY_ICON_SIZE 40
#define SIDEBAR_ENTRY_ICON_PADDING 15
#define ENTRY_PADDING_HORIZONTAL_HALF 60
#define ENTRY_PADDING_HORIZONTAL_FULL 150
#define ENTRY_PADDING_VERTICAL 20
#define ENTRY_HEIGHT 50
#define ENTRY_SPACING 8
#define ENTRY_ICON_SIZE 46
#define ENTRY_ICON_PADDING 15

#define SIDEBAR_WIDTH 408
#define SIDEBAR_X_PADDING 40
#define SIDEBAR_Y_PADDING 20
#define SIDEBAR_ENTRY_HEIGHT 50
#define SIDEBAR_ENTRY_Y_PADDING 10
#define SIDEBAR_ENTRY_ICON_SIZE 40
#define SIDEBAR_ENTRY_ICON_PADDING 15

#define CURSOR_SIZE 64

#define INTERVAL_BATTERY_LEVEL_CHECK (30 * 1000000)
#define INTERVAL_OSK_CURSOR (0.5f * 1000000)
#define INTERVAL_BATTERY_LEVEL_CHECK (30 * 1000000)
#define INTERVAL_OSK_CURSOR (0.5f * 1000000)

struct ozone_handle
{
Expand Down

0 comments on commit 59398e4

Please sign in to comment.