row: Moved button sizing closer to row

This commit is contained in:
Dorota Czaplejewicz
2019-08-16 13:34:54 +00:00
parent de9c93610b
commit c4b3a0aaaa
10 changed files with 30 additions and 43 deletions

View File

@ -34,7 +34,6 @@
#include "eek-renderer.h"
#include "eek-keyboard.h"
#include "eek-section.h"
#include "src/symbol.h"
#include "eek-gtk-keyboard.h"

View File

@ -30,7 +30,6 @@
#include "config.h"
#include <glib/gprintf.h>
#include "eek-section.h"
#include "eek-enumtypes.h"
#include "eekboard/key-emitter.h"
#include "keymap.h"

View File

@ -70,7 +70,7 @@ row_placer(gpointer item, gpointer user_data)
squeek_row_set_bounds(row, row_bounds);
// Gather up all the keys in a row and adjust their bounds.
eek_row_place_buttons(row, data->keyboard);
squeek_row_place_buttons(row, data->keyboard);
row_bounds = squeek_row_get_bounds(row);
row_bounds.y = data->current_offset;

View File

@ -24,7 +24,6 @@
#include <string.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "eek-section.h"
#include "src/symbol.h"
#include "eek-renderer.h"

View File

@ -54,17 +54,3 @@ EekBounds eek_get_outline_size(LevelKeyboard *keyboard, uint32_t oref) {
EekBounds bounds = {0, 0, 0, 0};
return bounds;
}
void
eek_row_place_buttons(struct squeek_row *row, LevelKeyboard *keyboard)
{
EekBounds row_size = squeek_row_place_keys(row, keyboard);
EekBounds row_bounds = squeek_row_get_bounds(row);
// FIXME: do centering of each row based on keyboard dimensions,
// one level up the iterators
// now centering by comparing previous width to the new, calculated one
row_bounds.x = (row_bounds.width - row_size.width) / 2;
row_bounds.width = row_size.width;
row_bounds.height = row_size.height;
squeek_row_set_bounds(row, row_bounds);
}

View File

@ -31,6 +31,4 @@
#include "eek-keyboard.h"
#include "src/layout.h"
void
eek_row_place_buttons(struct squeek_row *row, LevelKeyboard *keyboard);
#endif /* EEK_SECTION_H */

View File

@ -28,7 +28,6 @@
#include <string.h>
#include "eek-keyboard.h"
#include "eek-section.h"
#include "src/keyboard.h"
#include "src/symbol.h"

View File

@ -23,7 +23,6 @@
#define __EEK_H_INSIDE__ 1
#include "eek-keyboard.h"
#include "eek-section.h"
#include "eek-layout.h"
#include "eek-keysym.h"