diff --git a/ImageControlLook.cpp b/ImageControlLook.cpp index e263484..a6deeb0 100644 --- a/ImageControlLook.cpp +++ b/ImageControlLook.cpp @@ -14,15 +14,17 @@ ImageControlLook::ImageControlLook(image_id id) : HaikuControlLook() { - for (int i = 0; i < 3; i++) - fButton[i].fill(NULL); + for (int orient = 0; orient < 2; orient++) { + for (int side = 0; side < 3; side++) + fButton[orient][side].fill(NULL); - fCheckBox_Checked.fill(NULL); - fCheckBox_Unchecked.fill(NULL); - fRadioButton_Checked.fill(NULL); - fRadioButton_Unchecked.fill(NULL); - fSliderThumb.fill(NULL); - fSliderTriangle.fill(NULL); + fCheckBox_Checked[orient].fill(NULL); + fCheckBox_Unchecked[orient].fill(NULL); + fRadioButton_Checked[orient].fill(NULL); + fRadioButton_Unchecked[orient].fill(NULL); + fSliderThumb[orient].fill(NULL); + fSliderTriangle[orient].fill(NULL); + } fImageRoot = BPath("/boot/home/Desktop/projects/haiku/ImageControlLook/data/ImageThemes/Akva/"); } @@ -31,9 +33,18 @@ ImageControlLook::ImageControlLook(image_id id) ImageControlLook::~ImageControlLook() { - for (int i = 0; i < 3; i++) - for (int j = 0; j < 6; j++) - delete fButton[i][j]; + for (int orient = 0; orient < 2; orient++) + for (int state = 0; state < 5; state++) { + for (int side = 0; side < 3; side++) + delete fButton[orient][side][state]; + + delete fCheckBox_Checked[orient][state]; + delete fCheckBox_Unchecked[orient][state]; + delete fRadioButton_Checked[orient][state]; + delete fRadioButton_Unchecked[orient][state]; + delete fSliderThumb[orient][state]; + delete fSliderTriangle[orient][state]; + } } @@ -42,7 +53,7 @@ void ImageControlLook::DrawButtonFrame(BView* view, BRect& rect, const BRect& updateRect, const rgb_color& base, const rgb_color& background, uint32 flags, uint32 borders) { - if (_Image("Button", ICL_MIDDLE, ICL_NORMAL) == NULL) + if (_Image("Button", ICL_NORMAL, ICL_MIDDLE) == NULL) HaikuControlLook::DrawButtonFrame(view, rect, updateRect, base, background, flags, borders); } @@ -51,7 +62,7 @@ void ImageControlLook::DrawButtonFrame(BView* view, BRect& rect, const BRect& updateRect, float radius, const rgb_color& base, const rgb_color& background, uint32 flags, uint32 borders) { - if (_Image("Button", ICL_MIDDLE, ICL_NORMAL) == NULL) + if (_Image("Button", ICL_NORMAL, ICL_MIDDLE) == NULL) HaikuControlLook::DrawButtonFrame(view, rect, updateRect, radius, base, background, flags, borders); } @@ -62,7 +73,7 @@ ImageControlLook::DrawButtonFrame(BView* view, BRect& rect, const BRect& updateR float leftTopRadius, float rightTopRadius, float leftBottomRadius, float rightBottomRadius, const rgb_color& base, const rgb_color& background, uint32 flags, uint32 borders) { - if (_Image("Button", ICL_MIDDLE, ICL_NORMAL) == NULL) + if (_Image("Button", ICL_NORMAL, ICL_MIDDLE) == NULL) HaikuControlLook::DrawButtonFrame(view, rect, updateRect, leftTopRadius, rightTopRadius, leftBottomRadius, rightBottomRadius, base, background, flags, borders); } @@ -72,7 +83,7 @@ void ImageControlLook::DrawButtonBackground(BView* view, BRect& rect, const BRect& updateRect, const rgb_color& base, uint32 flags, uint32 borders, orientation orientation) { - if (!_DrawTiledImage("Button", _FlagsToState(flags), view, rect, updateRect, orientation)) + if (!_DrawTiledImage("Button", flags, view, rect, updateRect, orientation)) HaikuControlLook::DrawButtonBackground(view, rect, updateRect, base, flags, borders, orientation); } @@ -82,7 +93,7 @@ void ImageControlLook::DrawButtonBackground(BView* view, BRect& rect, const BRect& updateRect, float radius, const rgb_color& base, uint32 flags, uint32 borders, orientation orientation) { - if (!_DrawTiledImage("Button", _FlagsToState(flags), view, rect, updateRect, orientation)) + if (!_DrawTiledImage("Button", flags, view, rect, updateRect, orientation)) HaikuControlLook::DrawButtonBackground(view, rect, updateRect, radius, base, flags, borders, orientation); } @@ -93,7 +104,7 @@ ImageControlLook::DrawButtonBackground(BView* view, BRect& rect, const BRect& up float leftTopRadius, float rightTopRadius, float leftBottomRadius, float rightBottomRadius, const rgb_color& base, uint32 flags, uint32 borders, orientation orientation) { - if (!_DrawTiledImage("Button", _FlagsToState(flags), view, rect, updateRect, orientation)) + if (!_DrawTiledImage("Button", flags, view, rect, updateRect, orientation)) HaikuControlLook::DrawButtonBackground(view, rect, updateRect, leftTopRadius, rightTopRadius,leftBottomRadius, rightBottomRadius, base, flags, borders, orientation); } @@ -105,9 +116,9 @@ ImageControlLook::DrawCheckBox(BView* view, BRect& rect, const BRect& updateRect { bool drawn = false; if (((BControl*)view)->Value() == B_CONTROL_ON) - drawn = _DrawImage("CheckBox-Checked", _FlagsToState(flags & ~B_ACTIVATED), view, rect); + drawn = _DrawImage("CheckBox-Checked", flags & ~B_ACTIVATED, view, rect); else - drawn = _DrawImage("CheckBox-Unchecked", _FlagsToState(flags), view, rect); + drawn = _DrawImage("CheckBox-Unchecked", flags, view, rect); if (!drawn) HaikuControlLook::DrawCheckBox(view, rect, updateRect, base, flags); @@ -120,9 +131,9 @@ ImageControlLook::DrawRadioButton(BView* view, BRect& rect, const BRect& updateR { bool drawn = false; if (((BControl*)view)->Value() == B_CONTROL_ON) - drawn = _DrawImage("RadioButton-Checked", _FlagsToState(flags & ~B_ACTIVATED), view, rect); + drawn = _DrawImage("RadioButton-Checked", flags & ~B_ACTIVATED, view, rect); else - drawn = _DrawImage("RadioButton-Unchecked", _FlagsToState(flags), view, rect); + drawn = _DrawImage("RadioButton-Unchecked", flags, view, rect); if (!drawn) HaikuControlLook::DrawRadioButton(view, rect, updateRect, base, flags); @@ -133,7 +144,7 @@ void ImageControlLook::DrawSliderThumb(BView* view, BRect& rect, const BRect& updateRect, const rgb_color& base, uint32 flags, orientation orientation) { - if (!_DrawImage("SliderThumb", _FlagsToState(flags), view, rect, orientation)) + if (!_DrawImage("SliderThumb", flags, view, rect, orientation)) HaikuControlLook::DrawSliderThumb(view, rect, updateRect, base, flags, orientation); } @@ -142,7 +153,7 @@ void ImageControlLook::DrawSliderTriangle(BView* view, BRect& rect, const BRect& updateRect, const rgb_color& base, uint32 flags, orientation orientation) { - if (!_DrawImage("SliderTriangle", _FlagsToState(flags), view, rect, orientation)) + if (!_DrawImage("SliderTriangle", flags, view, rect, orientation)) HaikuControlLook::DrawSliderTriangle(view, rect, updateRect, base, flags, orientation); } @@ -151,18 +162,18 @@ void ImageControlLook::DrawSliderTriangle(BView* view, BRect& rect, const BRect& updateRect, const rgb_color& base, const rgb_color& fill, uint32 flags, orientation orientation) { - if (!_DrawImage("SliderTriangle", _FlagsToState(flags), view, rect, orientation)) + if (!_DrawImage("SliderTriangle", flags, view, rect, orientation)) HaikuControlLook::DrawSliderTriangle(view, rect, updateRect, base, fill, flags, orientation); } bool -ImageControlLook::_DrawImage(const char* type, uint32 state, BView* view, BRect rect, - orientation orientation) +ImageControlLook::_DrawImage(const char* type, icl_state state, BView* view, BRect rect, + icl_orient orientation) { - BBitmap* image = _Image(type, state); - if (image != NULL && orientation == B_HORIZONTAL) { + BBitmap* image = _Image(type, state, ICL_NO_SIDE, orientation); + if (image != NULL) { view->SetDrawingMode(B_OP_ALPHA); view->DrawBitmap(image, rect); return true; @@ -172,48 +183,86 @@ ImageControlLook::_DrawImage(const char* type, uint32 state, BView* view, BRect bool -ImageControlLook::_DrawTiledImage(const char* type, uint32 state, BView* view, BRect rect, - BRect updateRect, orientation orientation) +ImageControlLook::_DrawImage(const char* type, uint32 flags, BView* view, BRect rect, + orientation orientation) { - BBitmap* tile = _Image(type, state, ICL_MIDDLE); - BBitmap* left = _Image(type, state, ICL_LEFT); - BBitmap* right = _Image(type, state, ICL_RIGHT); + return _DrawImage(type, _FlagsToState(flags), view, rect, _ICLOrientation(orientation)); +} - if (orientation == B_VERTICAL || tile == NULL) + +bool +ImageControlLook::_DrawTiledImage(const char* type, icl_state state, BView* view, BRect rect, + BRect updateRect, icl_orient orientation) +{ + BBitmap* tile = _Image(type, state, ICL_MIDDLE, orientation); + BBitmap* left = _Image(type, state, ICL_LEFT, orientation); + BBitmap* right = _Image(type, state, ICL_RIGHT, orientation); + + if (tile == NULL) return false; - float minX = 0; - float maxX = rect.Width(); - if (left != NULL) - minX = left->Bounds().Width(); - if (right != NULL) - maxX = rect.Width() - right->Bounds().Width(); + bool horiz = orientation == ICL_HORIZONTAL; - float heightRatio = rect.Height() / tile->Bounds().Height(); - float sliceWidth = heightRatio * tile->Bounds().Width(); + float min = 0; + float max = horiz ? rect.Width() : rect.Height(); + if (left != NULL) + min = horiz ? left->Bounds().Width() : left->Bounds().Height(); + if (right != NULL) + if (horiz) + max = rect.Width() - right->Bounds().Width(); + else + max = rect.Height() - right->Bounds().Height(); + + float sliceRatio = rect.Height() / tile->Bounds().Height(); + float sliceSize = sliceRatio * tile->Bounds().Width(); + if (!horiz) { + sliceRatio = rect.Width() / tile->Bounds().Width(); + sliceSize = sliceRatio * tile->Bounds().Height(); + } view->SetDrawingMode(B_OP_ALPHA); + // This is repetitive and not done well (the horiz and vert blocks are pretty much identical) BRect tileRect; - tileRect.top = 0; - tileRect.bottom = rect.Height(); - for (float left = minX; left + sliceWidth < maxX; left += sliceWidth) { - tileRect.left = left; - tileRect.right = left + sliceWidth; + if (horiz) { + tileRect.top = 0; + tileRect.bottom = rect.Height(); + for (float left = min; left + sliceSize < max; left += sliceSize) { + tileRect.left = left; + tileRect.right = left + sliceSize; + if (tileRect.Intersects(updateRect)) + view->DrawBitmap(tile, tileRect); + } + tileRect.right = max; + tileRect.left = max - sliceSize; + if (tileRect.Intersects(updateRect)) + view->DrawBitmap(tile, tileRect); + } else { + tileRect.left = 0; + tileRect.right = rect.Width(); + for (float top = min; top + sliceSize < max; top += sliceSize) { + tileRect.top = top; + tileRect.bottom = top + sliceSize; + if (tileRect.Intersects(updateRect)) + view->DrawBitmap(tile, tileRect); + } + tileRect.bottom = max; + tileRect.top = max - sliceSize; if (tileRect.Intersects(updateRect)) view->DrawBitmap(tile, tileRect); } - tileRect.right = maxX; - tileRect.left = maxX - sliceWidth; - if (tileRect.Intersects(updateRect)) - view->DrawBitmap(tile, tileRect); - BRect sideRect(0, 0, minX, rect.Height()); + BRect sideRect = horiz ? BRect(0, 0, min, rect.Height()) : BRect(0, 0, rect.Width(), min); if (left != NULL && sideRect.Intersects(updateRect)) view->DrawBitmap(left, sideRect); - sideRect.left = maxX; - sideRect.right = view->Bounds().right; + if (horiz) { + sideRect.left = max; + sideRect.right = view->Bounds().right; + } else { + sideRect.top = max; + sideRect.bottom = view->Bounds().bottom; + } if (right != NULL && sideRect.Intersects(updateRect)) view->DrawBitmap(right, sideRect); @@ -221,8 +270,17 @@ ImageControlLook::_DrawTiledImage(const char* type, uint32 state, BView* view, B } +bool +ImageControlLook::_DrawTiledImage(const char* type, uint32 flags, BView* view, BRect rect, + BRect updateRect, orientation orientation) +{ + return _DrawTiledImage(type, _FlagsToState(flags), view, rect, updateRect, + _ICLOrientation(orientation)); +} + + BBitmap* -ImageControlLook::_Image(const char* type, uint32 state, uint32 side) +ImageControlLook::_Image(const char* type, icl_state state, icl_side side, icl_orient orientation) { SidedImages* sideList = NULL; UnsidedImages* nosideList = NULL; @@ -243,27 +301,33 @@ ImageControlLook::_Image(const char* type, uint32 state, uint32 side) else if (strcmp(type, "SliderTriangle") == 0) nosideList = &fSliderTriangle; - if (sideList != NULL && (*sideList)[side][state] == NULL) - (*sideList)[side][state] = BTranslationUtils::GetBitmapFile(_ImagePath(type, state, side)); + if (sideList != NULL && (*sideList)[orientation][side][state] == NULL) + (*sideList)[orientation][side][state] + = BTranslationUtils::GetBitmapFile(_ImagePath(type, state, side, orientation)); if (sideList != NULL) - image = (*sideList)[side][state]; + image = (*sideList)[orientation][side][state]; - if (nosideList != NULL && (*nosideList)[state] == NULL) - (*nosideList)[state] = BTranslationUtils::GetBitmapFile(_ImagePath(type, state)); + if (nosideList != NULL && (*nosideList)[orientation][state] == NULL) + (*nosideList)[orientation][state] + = BTranslationUtils::GetBitmapFile(_ImagePath(type, state, ICL_NO_SIDE, orientation)); if (nosideList != NULL) - image = (*nosideList)[state]; + image = (*nosideList)[orientation][state]; return image; } const char* -ImageControlLook::_ImagePath(const char* type, uint32 state, uint32 side) +ImageControlLook::_ImagePath(const char* type, icl_state state, icl_side side, icl_orient orientation) { BString leaf = kStates[state]; leaf << kSides[side]; BPath imgPath(fImageRoot.Path()); + if (orientation == ICL_VERTICAL) + imgPath.Append("Vertical"); + else + imgPath.Append("Horizontal"); imgPath.Append(type); imgPath.Append(leaf); printf("[ImageControlLook] Searching for %s…\n", imgPath.Path()); @@ -271,10 +335,10 @@ ImageControlLook::_ImagePath(const char* type, uint32 state, uint32 side) } -uint32 +icl_state ImageControlLook::_FlagsToState(uint32 flags) { - uint32 state = ICL_NORMAL; + icl_state state = ICL_NORMAL; if (flags & B_DISABLED) state = ICL_DISABLED; else if (flags & (B_ACTIVATED | B_PARTIALLY_ACTIVATED | B_CLICKED)) @@ -285,6 +349,15 @@ ImageControlLook::_FlagsToState(uint32 flags) } +icl_orient +ImageControlLook::_ICLOrientation(orientation orientation) +{ + if (orientation == B_VERTICAL) + return ICL_VERTICAL; + return ICL_HORIZONTAL; +} + + extern "C" BControlLook* (instantiate_control_look)(image_id id) { return new (std::nothrow)ImageControlLook(id); diff --git a/ImageControlLook.h b/ImageControlLook.h index d5bbdaa..c45727d 100644 --- a/ImageControlLook.h +++ b/ImageControlLook.h @@ -20,14 +20,19 @@ class BView; using BPrivate::HaikuControlLook; -enum { +enum icl_orient { + ICL_HORIZONTAL, + ICL_VERTICAL +}; + +enum icl_side { ICL_MIDDLE, ICL_LEFT, ICL_RIGHT, ICL_NO_SIDE }; -enum { +enum icl_state { ICL_NORMAL, ICL_INACTIVE, ICL_HOVER, @@ -40,8 +45,8 @@ const char* kStates[] = { "Normal", "Inactive", "Hover", "Disabled", "Activated" const char* kSides[] = { "Middle", "Left", "Right", "" }; -typedef std::array, 3> SidedImages; -typedef std::array UnsidedImages; +typedef std::array, 3>, 2> SidedImages; +typedef std::array, 2> UnsidedImages; class ImageControlLook : public HaikuControlLook { @@ -123,17 +128,27 @@ public: orientation orientation); private: - bool _DrawImage(const char* type, uint32 state, BView* view, BRect rect, + bool _DrawImage(const char* type, icl_state state, BView* view, BRect rect, + icl_orient orientation = ICL_HORIZONTAL); + bool _DrawImage(const char* type, uint32 flags, BView* view, BRect rect, orientation orientation = B_HORIZONTAL); - bool _DrawTiledImage(const char* type, uint32 state, BView* view, + + bool _DrawTiledImage(const char* type, icl_state state, BView* view, + BRect rect, BRect updateRect, + icl_orient orientation = ICL_HORIZONTAL); + bool _DrawTiledImage(const char* type, uint32 flags, BView* view, BRect rect, BRect updateRect, orientation orientation = B_HORIZONTAL); - BBitmap* _Image(const char* type, uint32 state, uint32 side = ICL_NO_SIDE); - const char* _ImagePath(const char* type, uint32 state, - uint32 side = ICL_NO_SIDE); + BBitmap* _Image(const char* type, icl_state state, + icl_side side = ICL_NO_SIDE, + icl_orient orientation = ICL_HORIZONTAL); + const char* _ImagePath(const char* type, icl_state state, + icl_side side = ICL_NO_SIDE, + icl_orient orientation = ICL_HORIZONTAL); - uint32 _FlagsToState(uint32 flags); + icl_state _FlagsToState(uint32 flags); + icl_orient _ICLOrientation(orientation orientation); BPath fImageRoot; diff --git a/data/ImageThemes/Akva/Button/ActivatedLeft b/data/ImageThemes/Akva/Horizontal/Button/ActivatedLeft similarity index 100% rename from data/ImageThemes/Akva/Button/ActivatedLeft rename to data/ImageThemes/Akva/Horizontal/Button/ActivatedLeft diff --git a/data/ImageThemes/Akva/Button/ActivatedMiddle b/data/ImageThemes/Akva/Horizontal/Button/ActivatedMiddle similarity index 100% rename from data/ImageThemes/Akva/Button/ActivatedMiddle rename to data/ImageThemes/Akva/Horizontal/Button/ActivatedMiddle diff --git a/data/ImageThemes/Akva/Button/ActivatedRight b/data/ImageThemes/Akva/Horizontal/Button/ActivatedRight similarity index 100% rename from data/ImageThemes/Akva/Button/ActivatedRight rename to data/ImageThemes/Akva/Horizontal/Button/ActivatedRight diff --git a/data/ImageThemes/Akva/Button/DisabledLeft b/data/ImageThemes/Akva/Horizontal/Button/DisabledLeft similarity index 100% rename from data/ImageThemes/Akva/Button/DisabledLeft rename to data/ImageThemes/Akva/Horizontal/Button/DisabledLeft diff --git a/data/ImageThemes/Akva/Button/DisabledMiddle b/data/ImageThemes/Akva/Horizontal/Button/DisabledMiddle similarity index 100% rename from data/ImageThemes/Akva/Button/DisabledMiddle rename to data/ImageThemes/Akva/Horizontal/Button/DisabledMiddle diff --git a/data/ImageThemes/Akva/Button/DisabledRight b/data/ImageThemes/Akva/Horizontal/Button/DisabledRight similarity index 100% rename from data/ImageThemes/Akva/Button/DisabledRight rename to data/ImageThemes/Akva/Horizontal/Button/DisabledRight diff --git a/data/ImageThemes/Akva/Button/HoverLeft b/data/ImageThemes/Akva/Horizontal/Button/HoverLeft similarity index 100% rename from data/ImageThemes/Akva/Button/HoverLeft rename to data/ImageThemes/Akva/Horizontal/Button/HoverLeft diff --git a/data/ImageThemes/Akva/Button/HoverMiddle b/data/ImageThemes/Akva/Horizontal/Button/HoverMiddle similarity index 100% rename from data/ImageThemes/Akva/Button/HoverMiddle rename to data/ImageThemes/Akva/Horizontal/Button/HoverMiddle diff --git a/data/ImageThemes/Akva/Button/HoverRight b/data/ImageThemes/Akva/Horizontal/Button/HoverRight similarity index 100% rename from data/ImageThemes/Akva/Button/HoverRight rename to data/ImageThemes/Akva/Horizontal/Button/HoverRight diff --git a/data/ImageThemes/Akva/Button/InactiveLeft b/data/ImageThemes/Akva/Horizontal/Button/InactiveLeft similarity index 100% rename from data/ImageThemes/Akva/Button/InactiveLeft rename to data/ImageThemes/Akva/Horizontal/Button/InactiveLeft diff --git a/data/ImageThemes/Akva/Button/InactiveMiddle b/data/ImageThemes/Akva/Horizontal/Button/InactiveMiddle similarity index 100% rename from data/ImageThemes/Akva/Button/InactiveMiddle rename to data/ImageThemes/Akva/Horizontal/Button/InactiveMiddle diff --git a/data/ImageThemes/Akva/Button/InactiveRight b/data/ImageThemes/Akva/Horizontal/Button/InactiveRight similarity index 100% rename from data/ImageThemes/Akva/Button/InactiveRight rename to data/ImageThemes/Akva/Horizontal/Button/InactiveRight diff --git a/data/ImageThemes/Akva/Button/NormalLeft b/data/ImageThemes/Akva/Horizontal/Button/NormalLeft similarity index 100% rename from data/ImageThemes/Akva/Button/NormalLeft rename to data/ImageThemes/Akva/Horizontal/Button/NormalLeft diff --git a/data/ImageThemes/Akva/Button/NormalMiddle b/data/ImageThemes/Akva/Horizontal/Button/NormalMiddle similarity index 100% rename from data/ImageThemes/Akva/Button/NormalMiddle rename to data/ImageThemes/Akva/Horizontal/Button/NormalMiddle diff --git a/data/ImageThemes/Akva/Button/NormalRight b/data/ImageThemes/Akva/Horizontal/Button/NormalRight similarity index 100% rename from data/ImageThemes/Akva/Button/NormalRight rename to data/ImageThemes/Akva/Horizontal/Button/NormalRight diff --git a/data/ImageThemes/Akva/CheckBox-Checked/Activated b/data/ImageThemes/Akva/Horizontal/CheckBox-Checked/Activated similarity index 100% rename from data/ImageThemes/Akva/CheckBox-Checked/Activated rename to data/ImageThemes/Akva/Horizontal/CheckBox-Checked/Activated diff --git a/data/ImageThemes/Akva/CheckBox-Checked/Disabled b/data/ImageThemes/Akva/Horizontal/CheckBox-Checked/Disabled similarity index 100% rename from data/ImageThemes/Akva/CheckBox-Checked/Disabled rename to data/ImageThemes/Akva/Horizontal/CheckBox-Checked/Disabled diff --git a/data/ImageThemes/Akva/CheckBox-Checked/Hover b/data/ImageThemes/Akva/Horizontal/CheckBox-Checked/Hover similarity index 100% rename from data/ImageThemes/Akva/CheckBox-Checked/Hover rename to data/ImageThemes/Akva/Horizontal/CheckBox-Checked/Hover diff --git a/data/ImageThemes/Akva/CheckBox-Checked/Inactive b/data/ImageThemes/Akva/Horizontal/CheckBox-Checked/Inactive similarity index 100% rename from data/ImageThemes/Akva/CheckBox-Checked/Inactive rename to data/ImageThemes/Akva/Horizontal/CheckBox-Checked/Inactive diff --git a/data/ImageThemes/Akva/CheckBox-Checked/Normal b/data/ImageThemes/Akva/Horizontal/CheckBox-Checked/Normal similarity index 100% rename from data/ImageThemes/Akva/CheckBox-Checked/Normal rename to data/ImageThemes/Akva/Horizontal/CheckBox-Checked/Normal diff --git a/data/ImageThemes/Akva/CheckBox-Unchecked/Activated b/data/ImageThemes/Akva/Horizontal/CheckBox-Unchecked/Activated similarity index 100% rename from data/ImageThemes/Akva/CheckBox-Unchecked/Activated rename to data/ImageThemes/Akva/Horizontal/CheckBox-Unchecked/Activated diff --git a/data/ImageThemes/Akva/CheckBox-Unchecked/Disabled b/data/ImageThemes/Akva/Horizontal/CheckBox-Unchecked/Disabled similarity index 100% rename from data/ImageThemes/Akva/CheckBox-Unchecked/Disabled rename to data/ImageThemes/Akva/Horizontal/CheckBox-Unchecked/Disabled diff --git a/data/ImageThemes/Akva/CheckBox-Unchecked/Hover b/data/ImageThemes/Akva/Horizontal/CheckBox-Unchecked/Hover similarity index 100% rename from data/ImageThemes/Akva/CheckBox-Unchecked/Hover rename to data/ImageThemes/Akva/Horizontal/CheckBox-Unchecked/Hover diff --git a/data/ImageThemes/Akva/CheckBox-Unchecked/Inactive b/data/ImageThemes/Akva/Horizontal/CheckBox-Unchecked/Inactive similarity index 100% rename from data/ImageThemes/Akva/CheckBox-Unchecked/Inactive rename to data/ImageThemes/Akva/Horizontal/CheckBox-Unchecked/Inactive diff --git a/data/ImageThemes/Akva/CheckBox-Unchecked/Normal b/data/ImageThemes/Akva/Horizontal/CheckBox-Unchecked/Normal similarity index 100% rename from data/ImageThemes/Akva/CheckBox-Unchecked/Normal rename to data/ImageThemes/Akva/Horizontal/CheckBox-Unchecked/Normal diff --git a/data/ImageThemes/Akva/RadioButton-Checked/Activated b/data/ImageThemes/Akva/Horizontal/RadioButton-Checked/Activated similarity index 100% rename from data/ImageThemes/Akva/RadioButton-Checked/Activated rename to data/ImageThemes/Akva/Horizontal/RadioButton-Checked/Activated diff --git a/data/ImageThemes/Akva/RadioButton-Checked/Disabled b/data/ImageThemes/Akva/Horizontal/RadioButton-Checked/Disabled similarity index 100% rename from data/ImageThemes/Akva/RadioButton-Checked/Disabled rename to data/ImageThemes/Akva/Horizontal/RadioButton-Checked/Disabled diff --git a/data/ImageThemes/Akva/RadioButton-Checked/Hover b/data/ImageThemes/Akva/Horizontal/RadioButton-Checked/Hover similarity index 100% rename from data/ImageThemes/Akva/RadioButton-Checked/Hover rename to data/ImageThemes/Akva/Horizontal/RadioButton-Checked/Hover diff --git a/data/ImageThemes/Akva/RadioButton-Checked/Inactive b/data/ImageThemes/Akva/Horizontal/RadioButton-Checked/Inactive similarity index 100% rename from data/ImageThemes/Akva/RadioButton-Checked/Inactive rename to data/ImageThemes/Akva/Horizontal/RadioButton-Checked/Inactive diff --git a/data/ImageThemes/Akva/RadioButton-Checked/Normal b/data/ImageThemes/Akva/Horizontal/RadioButton-Checked/Normal similarity index 100% rename from data/ImageThemes/Akva/RadioButton-Checked/Normal rename to data/ImageThemes/Akva/Horizontal/RadioButton-Checked/Normal diff --git a/data/ImageThemes/Akva/RadioButton-Unchecked/Activated b/data/ImageThemes/Akva/Horizontal/RadioButton-Unchecked/Activated similarity index 100% rename from data/ImageThemes/Akva/RadioButton-Unchecked/Activated rename to data/ImageThemes/Akva/Horizontal/RadioButton-Unchecked/Activated diff --git a/data/ImageThemes/Akva/RadioButton-Unchecked/Disabled b/data/ImageThemes/Akva/Horizontal/RadioButton-Unchecked/Disabled similarity index 100% rename from data/ImageThemes/Akva/RadioButton-Unchecked/Disabled rename to data/ImageThemes/Akva/Horizontal/RadioButton-Unchecked/Disabled diff --git a/data/ImageThemes/Akva/RadioButton-Unchecked/Hover b/data/ImageThemes/Akva/Horizontal/RadioButton-Unchecked/Hover similarity index 100% rename from data/ImageThemes/Akva/RadioButton-Unchecked/Hover rename to data/ImageThemes/Akva/Horizontal/RadioButton-Unchecked/Hover diff --git a/data/ImageThemes/Akva/RadioButton-Unchecked/Inactive b/data/ImageThemes/Akva/Horizontal/RadioButton-Unchecked/Inactive similarity index 100% rename from data/ImageThemes/Akva/RadioButton-Unchecked/Inactive rename to data/ImageThemes/Akva/Horizontal/RadioButton-Unchecked/Inactive diff --git a/data/ImageThemes/Akva/RadioButton-Unchecked/Normal b/data/ImageThemes/Akva/Horizontal/RadioButton-Unchecked/Normal similarity index 100% rename from data/ImageThemes/Akva/RadioButton-Unchecked/Normal rename to data/ImageThemes/Akva/Horizontal/RadioButton-Unchecked/Normal diff --git a/data/ImageThemes/Akva/SliderBar/NormalLeft b/data/ImageThemes/Akva/Horizontal/SliderBar/NormalLeft similarity index 100% rename from data/ImageThemes/Akva/SliderBar/NormalLeft rename to data/ImageThemes/Akva/Horizontal/SliderBar/NormalLeft diff --git a/data/ImageThemes/Akva/SliderBar/NormalMiddle b/data/ImageThemes/Akva/Horizontal/SliderBar/NormalMiddle similarity index 100% rename from data/ImageThemes/Akva/SliderBar/NormalMiddle rename to data/ImageThemes/Akva/Horizontal/SliderBar/NormalMiddle diff --git a/data/ImageThemes/Akva/SliderBar/NormalRight b/data/ImageThemes/Akva/Horizontal/SliderBar/NormalRight similarity index 100% rename from data/ImageThemes/Akva/SliderBar/NormalRight rename to data/ImageThemes/Akva/Horizontal/SliderBar/NormalRight diff --git a/data/ImageThemes/Akva/SliderBar/README.txt b/data/ImageThemes/Akva/Horizontal/SliderBar/README.txt similarity index 100% rename from data/ImageThemes/Akva/SliderBar/README.txt rename to data/ImageThemes/Akva/Horizontal/SliderBar/README.txt diff --git a/data/ImageThemes/Akva/SliderThumb/Activated b/data/ImageThemes/Akva/Horizontal/SliderThumb/Activated similarity index 100% rename from data/ImageThemes/Akva/SliderThumb/Activated rename to data/ImageThemes/Akva/Horizontal/SliderThumb/Activated diff --git a/data/ImageThemes/Akva/SliderThumb/Disabled b/data/ImageThemes/Akva/Horizontal/SliderThumb/Disabled similarity index 100% rename from data/ImageThemes/Akva/SliderThumb/Disabled rename to data/ImageThemes/Akva/Horizontal/SliderThumb/Disabled diff --git a/data/ImageThemes/Akva/SliderThumb/Hover b/data/ImageThemes/Akva/Horizontal/SliderThumb/Hover similarity index 100% rename from data/ImageThemes/Akva/SliderThumb/Hover rename to data/ImageThemes/Akva/Horizontal/SliderThumb/Hover diff --git a/data/ImageThemes/Akva/SliderThumb/Inactive b/data/ImageThemes/Akva/Horizontal/SliderThumb/Inactive similarity index 100% rename from data/ImageThemes/Akva/SliderThumb/Inactive rename to data/ImageThemes/Akva/Horizontal/SliderThumb/Inactive diff --git a/data/ImageThemes/Akva/SliderThumb/Normal b/data/ImageThemes/Akva/Horizontal/SliderThumb/Normal similarity index 100% rename from data/ImageThemes/Akva/SliderThumb/Normal rename to data/ImageThemes/Akva/Horizontal/SliderThumb/Normal diff --git a/data/ImageThemes/Akva/SliderTriangle/Activated b/data/ImageThemes/Akva/Horizontal/SliderTriangle/Activated similarity index 100% rename from data/ImageThemes/Akva/SliderTriangle/Activated rename to data/ImageThemes/Akva/Horizontal/SliderTriangle/Activated diff --git a/data/ImageThemes/Akva/SliderTriangle/Disabled b/data/ImageThemes/Akva/Horizontal/SliderTriangle/Disabled similarity index 100% rename from data/ImageThemes/Akva/SliderTriangle/Disabled rename to data/ImageThemes/Akva/Horizontal/SliderTriangle/Disabled diff --git a/data/ImageThemes/Akva/SliderTriangle/Hover b/data/ImageThemes/Akva/Horizontal/SliderTriangle/Hover similarity index 100% rename from data/ImageThemes/Akva/SliderTriangle/Hover rename to data/ImageThemes/Akva/Horizontal/SliderTriangle/Hover diff --git a/data/ImageThemes/Akva/SliderTriangle/Inactive b/data/ImageThemes/Akva/Horizontal/SliderTriangle/Inactive similarity index 100% rename from data/ImageThemes/Akva/SliderTriangle/Inactive rename to data/ImageThemes/Akva/Horizontal/SliderTriangle/Inactive diff --git a/data/ImageThemes/Akva/SliderTriangle/Normal b/data/ImageThemes/Akva/Horizontal/SliderTriangle/Normal similarity index 100% rename from data/ImageThemes/Akva/SliderTriangle/Normal rename to data/ImageThemes/Akva/Horizontal/SliderTriangle/Normal diff --git a/data/ImageThemes/Akva/Vertical/Button/ActivatedLeft b/data/ImageThemes/Akva/Vertical/Button/ActivatedLeft new file mode 100644 index 0000000..ebf1448 Binary files /dev/null and b/data/ImageThemes/Akva/Vertical/Button/ActivatedLeft differ diff --git a/data/ImageThemes/Akva/Vertical/Button/ActivatedMiddle b/data/ImageThemes/Akva/Vertical/Button/ActivatedMiddle new file mode 100644 index 0000000..a29b293 Binary files /dev/null and b/data/ImageThemes/Akva/Vertical/Button/ActivatedMiddle differ diff --git a/data/ImageThemes/Akva/Vertical/Button/ActivatedRight b/data/ImageThemes/Akva/Vertical/Button/ActivatedRight new file mode 100644 index 0000000..04b5605 Binary files /dev/null and b/data/ImageThemes/Akva/Vertical/Button/ActivatedRight differ diff --git a/data/ImageThemes/Akva/Vertical/Button/DisabledLeft b/data/ImageThemes/Akva/Vertical/Button/DisabledLeft new file mode 100644 index 0000000..c419d08 Binary files /dev/null and b/data/ImageThemes/Akva/Vertical/Button/DisabledLeft differ diff --git a/data/ImageThemes/Akva/Vertical/Button/DisabledMiddle b/data/ImageThemes/Akva/Vertical/Button/DisabledMiddle new file mode 100644 index 0000000..f64a271 Binary files /dev/null and b/data/ImageThemes/Akva/Vertical/Button/DisabledMiddle differ diff --git a/data/ImageThemes/Akva/Vertical/Button/DisabledRight b/data/ImageThemes/Akva/Vertical/Button/DisabledRight new file mode 100644 index 0000000..6fd08ba Binary files /dev/null and b/data/ImageThemes/Akva/Vertical/Button/DisabledRight differ diff --git a/data/ImageThemes/Akva/Vertical/Button/HoverLeft b/data/ImageThemes/Akva/Vertical/Button/HoverLeft new file mode 100644 index 0000000..e719118 Binary files /dev/null and b/data/ImageThemes/Akva/Vertical/Button/HoverLeft differ diff --git a/data/ImageThemes/Akva/Vertical/Button/HoverMiddle b/data/ImageThemes/Akva/Vertical/Button/HoverMiddle new file mode 100644 index 0000000..04ecc38 Binary files /dev/null and b/data/ImageThemes/Akva/Vertical/Button/HoverMiddle differ diff --git a/data/ImageThemes/Akva/Vertical/Button/HoverRight b/data/ImageThemes/Akva/Vertical/Button/HoverRight new file mode 100644 index 0000000..0d0143b Binary files /dev/null and b/data/ImageThemes/Akva/Vertical/Button/HoverRight differ diff --git a/data/ImageThemes/Akva/Vertical/Button/InactiveLeft b/data/ImageThemes/Akva/Vertical/Button/InactiveLeft new file mode 100644 index 0000000..7731315 Binary files /dev/null and b/data/ImageThemes/Akva/Vertical/Button/InactiveLeft differ diff --git a/data/ImageThemes/Akva/Vertical/Button/InactiveMiddle b/data/ImageThemes/Akva/Vertical/Button/InactiveMiddle new file mode 100644 index 0000000..a0cbee4 Binary files /dev/null and b/data/ImageThemes/Akva/Vertical/Button/InactiveMiddle differ diff --git a/data/ImageThemes/Akva/Vertical/Button/InactiveRight b/data/ImageThemes/Akva/Vertical/Button/InactiveRight new file mode 100644 index 0000000..31f9bcd Binary files /dev/null and b/data/ImageThemes/Akva/Vertical/Button/InactiveRight differ diff --git a/data/ImageThemes/Akva/Vertical/Button/NormalLeft b/data/ImageThemes/Akva/Vertical/Button/NormalLeft new file mode 100644 index 0000000..c784f2e Binary files /dev/null and b/data/ImageThemes/Akva/Vertical/Button/NormalLeft differ diff --git a/data/ImageThemes/Akva/Vertical/Button/NormalMiddle b/data/ImageThemes/Akva/Vertical/Button/NormalMiddle new file mode 100644 index 0000000..142a0e3 Binary files /dev/null and b/data/ImageThemes/Akva/Vertical/Button/NormalMiddle differ diff --git a/data/ImageThemes/Akva/Vertical/Button/NormalRight b/data/ImageThemes/Akva/Vertical/Button/NormalRight new file mode 100644 index 0000000..386447e Binary files /dev/null and b/data/ImageThemes/Akva/Vertical/Button/NormalRight differ diff --git a/data/ImageThemes/Akva/Vertical/README.txt b/data/ImageThemes/Akva/Vertical/README.txt new file mode 100644 index 0000000..e953396 --- /dev/null +++ b/data/ImageThemes/Akva/Vertical/README.txt @@ -0,0 +1 @@ +These images were automatically generated from the Horizontal variants with util/RotateICLTheme.sh diff --git a/data/ImageThemes/Akva/Vertical/SliderThumb/Activated b/data/ImageThemes/Akva/Vertical/SliderThumb/Activated new file mode 100644 index 0000000..35eae16 Binary files /dev/null and b/data/ImageThemes/Akva/Vertical/SliderThumb/Activated differ diff --git a/data/ImageThemes/Akva/Vertical/SliderThumb/Disabled b/data/ImageThemes/Akva/Vertical/SliderThumb/Disabled new file mode 100644 index 0000000..a3e446a Binary files /dev/null and b/data/ImageThemes/Akva/Vertical/SliderThumb/Disabled differ diff --git a/data/ImageThemes/Akva/Vertical/SliderThumb/Hover b/data/ImageThemes/Akva/Vertical/SliderThumb/Hover new file mode 100644 index 0000000..9c51e1d Binary files /dev/null and b/data/ImageThemes/Akva/Vertical/SliderThumb/Hover differ diff --git a/data/ImageThemes/Akva/Vertical/SliderThumb/Inactive b/data/ImageThemes/Akva/Vertical/SliderThumb/Inactive new file mode 100644 index 0000000..d71c7eb Binary files /dev/null and b/data/ImageThemes/Akva/Vertical/SliderThumb/Inactive differ diff --git a/data/ImageThemes/Akva/Vertical/SliderThumb/Normal b/data/ImageThemes/Akva/Vertical/SliderThumb/Normal new file mode 100644 index 0000000..6daf473 Binary files /dev/null and b/data/ImageThemes/Akva/Vertical/SliderThumb/Normal differ diff --git a/data/ImageThemes/Akva/Vertical/SliderTriangle/Activated b/data/ImageThemes/Akva/Vertical/SliderTriangle/Activated new file mode 100644 index 0000000..75aebbe Binary files /dev/null and b/data/ImageThemes/Akva/Vertical/SliderTriangle/Activated differ diff --git a/data/ImageThemes/Akva/Vertical/SliderTriangle/Disabled b/data/ImageThemes/Akva/Vertical/SliderTriangle/Disabled new file mode 100644 index 0000000..9d172f0 Binary files /dev/null and b/data/ImageThemes/Akva/Vertical/SliderTriangle/Disabled differ diff --git a/data/ImageThemes/Akva/Vertical/SliderTriangle/Hover b/data/ImageThemes/Akva/Vertical/SliderTriangle/Hover new file mode 100644 index 0000000..a80de80 Binary files /dev/null and b/data/ImageThemes/Akva/Vertical/SliderTriangle/Hover differ diff --git a/data/ImageThemes/Akva/Vertical/SliderTriangle/Inactive b/data/ImageThemes/Akva/Vertical/SliderTriangle/Inactive new file mode 100644 index 0000000..f20eae9 Binary files /dev/null and b/data/ImageThemes/Akva/Vertical/SliderTriangle/Inactive differ diff --git a/data/ImageThemes/Akva/Vertical/SliderTriangle/Normal b/data/ImageThemes/Akva/Vertical/SliderTriangle/Normal new file mode 100644 index 0000000..7d9d345 Binary files /dev/null and b/data/ImageThemes/Akva/Vertical/SliderTriangle/Normal differ diff --git a/util/RotateICLTheme.sh b/util/RotateICLTheme.sh new file mode 100755 index 0000000..05dc481 --- /dev/null +++ b/util/RotateICLTheme.sh @@ -0,0 +1,28 @@ +#!/bin/sh +#――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― +# Name: RotateICLTheme.sh +# Desc: Creates vertical images from the horizontal versions of a theme's +# controls (for orientable controls). +# Reqs: ImageMagick +# Date: 2022-06 +#――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― + +ORIENTABLES="Button SliderThumb SliderTriangle" + +THEME_ROOT="$1" +if test -z "$THEME_ROOT" -o ! -d "$THEME_ROOT/Horizontal"; then + echo "Usage: $(basename $0) theme_root" + if test -n "$THEME_ROOT"; then + echo "" + echo "There is no 'Horizontal' directory under the given theme root, $THEME_ROOT." + echo "Please make sure you have your theme in the proper format." + fi + exit 2 +fi + +for orientable in $ORIENTABLES; do + mkdir -p "$THEME_ROOT/Vertical/$orientable" + for file in $THEME_ROOT/Horizontal/$orientable/*; do + convert -rotate "90" "$file" "$THEME_ROOT/Vertical/$orientable/$(basename "$file")" + done +done