Removed #ifdef ANDROID from where it's not needed
This commit is contained in:
@@ -1536,8 +1536,6 @@ public:
|
||||
class NWidgetMainToolbarContainer : public NWidgetToolbarContainer {
|
||||
/* virtual */ const byte *GetButtonArrangement(uint &width, uint &arrangable_count, uint &button_count, uint &spacer_count) const
|
||||
{
|
||||
#ifdef __ANDROID__
|
||||
|
||||
static const uint BIGGEST_ARRANGEMENT = 28;
|
||||
static const uint ARRANGEMENT_30 = 24;
|
||||
static const byte arrange_android_28[] = {
|
||||
@@ -1563,60 +1561,6 @@ class NWidgetMainToolbarContainer : public NWidgetToolbarContainer {
|
||||
}
|
||||
button_count = arrangable_count = lengthof(arrange_android_28) / 2;
|
||||
return &arrange_android_28[((_toolbar_mode == TB_LOWER) ? button_count : 0)];
|
||||
|
||||
#else
|
||||
|
||||
static const uint SMALLEST_ARRANGEMENT = 14;
|
||||
static const uint BIGGEST_ARRANGEMENT = 20;
|
||||
static const byte arrange14[] = {
|
||||
0, 1, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 29,
|
||||
2, 3, 4, 5, 6, 7, 8, 9, 12, 14, 26, 27, 28, 29,
|
||||
};
|
||||
static const byte arrange15[] = {
|
||||
0, 1, 4, 15, 16, 17, 18, 21, 22, 23, 24, 25, 19, 20, 29,
|
||||
0, 2, 4, 3, 5, 6, 7, 8, 9, 12, 14, 26, 27, 28, 29,
|
||||
};
|
||||
static const byte arrange16[] = {
|
||||
0, 1, 2, 4, 15, 16, 17, 18, 21, 22, 23, 24, 25, 19, 20, 29,
|
||||
0, 1, 3, 5, 6, 7, 8, 9, 12, 14, 26, 27, 28, 19, 20, 29,
|
||||
};
|
||||
static const byte arrange17[] = {
|
||||
0, 1, 2, 4, 6, 15, 16, 17, 18, 21, 22, 23, 24, 25, 19, 20, 29,
|
||||
0, 1, 3, 4, 6, 5, 7, 8, 9, 12, 14, 26, 27, 28, 19, 20, 29,
|
||||
};
|
||||
static const byte arrange18[] = {
|
||||
0, 1, 2, 4, 5, 6, 7, 8, 9, 14, 21, 22, 23, 24, 25, 19, 20, 29,
|
||||
0, 1, 3, 4, 5, 6, 7, 12, 15, 16, 17, 18, 26, 27, 28, 19, 20, 29,
|
||||
};
|
||||
static const byte arrange19[] = {
|
||||
0, 1, 2, 4, 5, 6, 15, 16, 17, 18, 21, 22, 23, 24, 25, 26, 19, 20, 29,
|
||||
0, 1, 3, 4, 7, 8, 9, 12, 14, 27, 21, 22, 23, 24, 25, 28, 19, 20, 29,
|
||||
};
|
||||
static const byte arrange20[] = {
|
||||
0, 1, 2, 4, 5, 6, 15, 16, 17, 18, 21, 22, 23, 24, 25, 26, 11, 19, 20, 29,
|
||||
0, 1, 3, 4, 7, 8, 9, 12, 14, 27, 21, 22, 23, 24, 25, 10, 28, 19, 20, 29,
|
||||
};
|
||||
static const byte arrange_all[] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28
|
||||
};
|
||||
|
||||
/* If at least BIGGEST_ARRANGEMENT fit, just spread all the buttons nicely */
|
||||
uint full_buttons = max(CeilDiv(width, this->smallest_x), SMALLEST_ARRANGEMENT);
|
||||
|
||||
if (full_buttons > BIGGEST_ARRANGEMENT) {
|
||||
button_count = arrangable_count = lengthof(arrange_all);
|
||||
spacer_count = this->spacers;
|
||||
return arrange_all;
|
||||
}
|
||||
|
||||
/* Introduce the split toolbar */
|
||||
static const byte * const arrangements[] = { arrange14, arrange15, arrange16, arrange17, arrange18, arrange19, arrange20 };
|
||||
|
||||
button_count = arrangable_count = full_buttons;
|
||||
spacer_count = this->spacers;
|
||||
return arrangements[full_buttons - SMALLEST_ARRANGEMENT] + ((_toolbar_mode == TB_LOWER) ? full_buttons : 0);
|
||||
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user