1
0
Disbranĉigi 0

Support for vertically-oriented controls

This involved some restructuring:
* Themes are now split into ./Horizontal and ./Vertical sections
* DrawTiledImage() and DrawImage() work for any orientation
* Better cleanup/initializing of the (now 3D) image arrays
* Use named enums for state/side/orientation
This commit is contained in:
Jaidyn Ann 2022-06-12 22:06:55 -05:00
parent bbb5916f5c
commit c2351d19db
78 changed files with 191 additions and 74 deletions

View File

@ -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;
if (horiz) {
tileRect.top = 0;
tileRect.bottom = rect.Height();
for (float left = minX; left + sliceWidth < maxX; left += sliceWidth) {
for (float left = min; left + sliceSize < max; left += sliceSize) {
tileRect.left = left;
tileRect.right = left + sliceWidth;
tileRect.right = left + sliceSize;
if (tileRect.Intersects(updateRect))
view->DrawBitmap(tile, tileRect);
}
tileRect.right = maxX;
tileRect.left = maxX - sliceWidth;
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);
}
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;
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);

View File

@ -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<std::array<BBitmap*, 5>, 3> SidedImages;
typedef std::array<BBitmap*, 5> UnsidedImages;
typedef std::array<std::array<std::array<BBitmap*, 5>, 3>, 2> SidedImages;
typedef std::array<std::array<BBitmap*, 5>, 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;

View File

Before

Width:  |  Height:  |  Size: 612 B

After

Width:  |  Height:  |  Size: 612 B

View File

Before

Width:  |  Height:  |  Size: 190 B

After

Width:  |  Height:  |  Size: 190 B

View File

Before

Width:  |  Height:  |  Size: 691 B

After

Width:  |  Height:  |  Size: 691 B

View File

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

View File

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

View File

Before

Width:  |  Height:  |  Size: 7.9 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

View File

Before

Width:  |  Height:  |  Size: 606 B

After

Width:  |  Height:  |  Size: 606 B

View File

Before

Width:  |  Height:  |  Size: 183 B

After

Width:  |  Height:  |  Size: 183 B

View File

Before

Width:  |  Height:  |  Size: 697 B

After

Width:  |  Height:  |  Size: 697 B

View File

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

View File

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

View File

Before

Width:  |  Height:  |  Size: 7.9 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

View File

Before

Width:  |  Height:  |  Size: 632 B

After

Width:  |  Height:  |  Size: 632 B

View File

Before

Width:  |  Height:  |  Size: 184 B

After

Width:  |  Height:  |  Size: 184 B

View File

Before

Width:  |  Height:  |  Size: 644 B

After

Width:  |  Height:  |  Size: 644 B

View File

Before

Width:  |  Height:  |  Size: 893 B

After

Width:  |  Height:  |  Size: 893 B

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 894 B

After

Width:  |  Height:  |  Size: 894 B

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

View File

Before

Width:  |  Height:  |  Size: 756 B

After

Width:  |  Height:  |  Size: 756 B

View File

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

View File

Before

Width:  |  Height:  |  Size: 648 B

After

Width:  |  Height:  |  Size: 648 B

View File

Before

Width:  |  Height:  |  Size: 963 B

After

Width:  |  Height:  |  Size: 963 B

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

Before

Width:  |  Height:  |  Size: 890 B

After

Width:  |  Height:  |  Size: 890 B

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

Before

Width:  |  Height:  |  Size: 901 B

After

Width:  |  Height:  |  Size: 901 B

View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

Before

Width:  |  Height:  |  Size: 832 B

After

Width:  |  Height:  |  Size: 832 B

View File

Before

Width:  |  Height:  |  Size: 136 B

After

Width:  |  Height:  |  Size: 136 B

View File

Before

Width:  |  Height:  |  Size: 93 B

After

Width:  |  Height:  |  Size: 93 B

View File

Before

Width:  |  Height:  |  Size: 135 B

After

Width:  |  Height:  |  Size: 135 B

View File

Before

Width:  |  Height:  |  Size: 668 B

After

Width:  |  Height:  |  Size: 668 B

View File

Before

Width:  |  Height:  |  Size: 657 B

After

Width:  |  Height:  |  Size: 657 B

View File

Before

Width:  |  Height:  |  Size: 670 B

After

Width:  |  Height:  |  Size: 670 B

View File

Before

Width:  |  Height:  |  Size: 670 B

After

Width:  |  Height:  |  Size: 670 B

View File

Before

Width:  |  Height:  |  Size: 681 B

After

Width:  |  Height:  |  Size: 681 B

View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 432 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 423 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1003 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 906 B

View File

@ -0,0 +1 @@
These images were automatically generated from the Horizontal variants with util/RotateICLTheme.sh

Binary file not shown.

After

Width:  |  Height:  |  Size: 999 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 995 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1010 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

28
util/RotateICLTheme.sh Executable file
View File

@ -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