From 4d4f707638dce03477738f7b72c701a180e8a4b4 Mon Sep 17 00:00:00 2001 From: pelya Date: Mon, 25 Aug 2014 00:37:48 +0300 Subject: [PATCH] Removed #ifdef ANDROID from where it's not needed --- src/toolbar_gui.cpp | 56 --------------------------------------------- 1 file changed, 56 deletions(-) diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp index 9a8641ad7f..c2d9dff9b3 100644 --- a/src/toolbar_gui.cpp +++ b/src/toolbar_gui.cpp @@ -1538,8 +1538,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[] = { @@ -1565,60 +1563,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 } };