mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-14 10:05:44 -04:00
Improve classic theme, add border for checkbox
This commit is contained in:
parent
4fbd5005f4
commit
cd367d8e97
@ -89,6 +89,21 @@ void LBackend_CalcOffsets(void) {
|
|||||||
yInputOffset = Display_ScaleY(2);
|
yInputOffset = Display_ScaleY(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void DrawBoxBounds(BitmapCol col, int x, int y, int width, int height) {
|
||||||
|
Drawer2D_Clear(&Launcher_Framebuffer, col,
|
||||||
|
x, y,
|
||||||
|
width, yBorder);
|
||||||
|
Drawer2D_Clear(&Launcher_Framebuffer, col,
|
||||||
|
x, y + height - yBorder,
|
||||||
|
width, yBorder);
|
||||||
|
Drawer2D_Clear(&Launcher_Framebuffer, col,
|
||||||
|
x, y,
|
||||||
|
xBorder, height);
|
||||||
|
Drawer2D_Clear(&Launcher_Framebuffer, col,
|
||||||
|
x + width - xBorder, y,
|
||||||
|
xBorder, height);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*########################################################################################################################*
|
/*########################################################################################################################*
|
||||||
*------------------------------------------------------ButtonWidget-------------------------------------------------------*
|
*------------------------------------------------------ButtonWidget-------------------------------------------------------*
|
||||||
@ -118,9 +133,7 @@ static void LButton_DrawBackground(struct LButton* w) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void LButton_DrawBorder(struct LButton* w) {
|
static void LButton_DrawBorder(struct LButton* w) {
|
||||||
BitmapCol black = BitmapCol_Make(0, 0, 0, 255);
|
BitmapCol backCol = Launcher_Theme.ButtonBorderColor;
|
||||||
BitmapCol backCol = Launcher_Theme.ClassicBackground ? black : Launcher_Theme.ButtonBorderColor;
|
|
||||||
|
|
||||||
Drawer2D_Clear(&Launcher_Framebuffer, backCol,
|
Drawer2D_Clear(&Launcher_Framebuffer, backCol,
|
||||||
w->x + xBorder, w->y,
|
w->x + xBorder, w->y,
|
||||||
w->width - xBorder2, yBorder);
|
w->width - xBorder2, yBorder);
|
||||||
@ -136,20 +149,20 @@ static void LButton_DrawBorder(struct LButton* w) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void LButton_DrawHighlight(struct LButton* w) {
|
static void LButton_DrawHighlight(struct LButton* w) {
|
||||||
BitmapCol activeCol = BitmapCol_Make(189, 198, 255, 255);
|
BitmapCol activeCol = BitmapCol_Make(189, 198, 255, 255);
|
||||||
BitmapCol inactiveCol = BitmapCol_Make(168, 168, 168, 255);
|
BitmapCol col = Launcher_Theme.ButtonHighlightColor;
|
||||||
BitmapCol highlightCol;
|
|
||||||
|
|
||||||
if (Launcher_Theme.ClassicBackground) {
|
if (Launcher_Theme.ClassicBackground) {
|
||||||
highlightCol = w->hovered ? activeCol : inactiveCol;
|
if (w->hovered) col = activeCol;
|
||||||
Drawer2D_Clear(&Launcher_Framebuffer, highlightCol,
|
|
||||||
|
Drawer2D_Clear(&Launcher_Framebuffer, col,
|
||||||
w->x + xBorder2, w->y + yBorder,
|
w->x + xBorder2, w->y + yBorder,
|
||||||
w->width - xBorder4, yBorder);
|
w->width - xBorder4, yBorder);
|
||||||
Drawer2D_Clear(&Launcher_Framebuffer, highlightCol,
|
Drawer2D_Clear(&Launcher_Framebuffer, col,
|
||||||
w->x + xBorder, w->y + yBorder2,
|
w->x + xBorder, w->y + yBorder2,
|
||||||
xBorder, w->height - yBorder4);
|
xBorder, w->height - yBorder4);
|
||||||
} else if (!w->hovered) {
|
} else if (!w->hovered) {
|
||||||
Drawer2D_Clear(&Launcher_Framebuffer, Launcher_Theme.ButtonHighlightColor,
|
Drawer2D_Clear(&Launcher_Framebuffer, col,
|
||||||
w->x + xBorder2, w->y + yBorder,
|
w->x + xBorder2, w->y + yBorder,
|
||||||
w->width - xBorder4, yBorder);
|
w->width - xBorder4, yBorder);
|
||||||
}
|
}
|
||||||
@ -246,7 +259,7 @@ void LBackend_DrawCheckbox(struct LCheckbox* w) {
|
|||||||
int y = w->y + w->height / 2 - size / 2;
|
int y = w->y + w->height / 2 - size / 2;
|
||||||
DrawIndexed(size, x, y, &Launcher_Framebuffer);
|
DrawIndexed(size, x, y, &Launcher_Framebuffer);
|
||||||
}
|
}
|
||||||
/*drawer.DrawRectBounds(black, 1, w->X, Y, Width - 1, Height - 1);*/
|
DrawBoxBounds(black, w->x, w->y, w->width, w->height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -257,18 +270,7 @@ static void LInput_DrawOuterBorder(struct LInput* w) {
|
|||||||
BitmapCol col = BitmapCol_Make(97, 81, 110, 255);
|
BitmapCol col = BitmapCol_Make(97, 81, 110, 255);
|
||||||
|
|
||||||
if (w->selected) {
|
if (w->selected) {
|
||||||
Drawer2D_Clear(&Launcher_Framebuffer, col,
|
DrawBoxBounds(col, w->x, w->y, w->width, w->height);
|
||||||
w->x, w->y,
|
|
||||||
w->width, yBorder);
|
|
||||||
Drawer2D_Clear(&Launcher_Framebuffer, col,
|
|
||||||
w->x, w->y + w->height - yBorder,
|
|
||||||
w->width, yBorder);
|
|
||||||
Drawer2D_Clear(&Launcher_Framebuffer, col,
|
|
||||||
w->x, w->y,
|
|
||||||
xBorder, w->height);
|
|
||||||
Drawer2D_Clear(&Launcher_Framebuffer, col,
|
|
||||||
w->x + w->width - xBorder, w->y,
|
|
||||||
xBorder, w->height);
|
|
||||||
} else {
|
} else {
|
||||||
Launcher_ResetArea(w->x, w->y,
|
Launcher_ResetArea(w->x, w->y,
|
||||||
w->width, yBorder);
|
w->width, yBorder);
|
||||||
|
@ -366,11 +366,11 @@ const struct LauncherTheme Launcher_ModernTheme = {
|
|||||||
|
|
||||||
const struct LauncherTheme Launcher_ClassicTheme = {
|
const struct LauncherTheme Launcher_ClassicTheme = {
|
||||||
true,
|
true,
|
||||||
BitmapCol_Make(153, 127, 172, 255), /* background WIP */
|
BitmapCol_Make( 50, 50, 50, 255), /* background */
|
||||||
BitmapCol_Make( 97, 81, 110, 255), /* button border WIP */
|
BitmapCol_Make( 0, 0, 0, 255), /* button border */
|
||||||
BitmapCol_Make(126, 136, 191, 255), /* active button */
|
BitmapCol_Make(126, 136, 191, 255), /* active button */
|
||||||
BitmapCol_Make(111, 111, 111, 255), /* button foreground */
|
BitmapCol_Make(111, 111, 111, 255), /* button foreground */
|
||||||
BitmapCol_Make(162, 131, 186, 255), /* button highlight WIP */
|
BitmapCol_Make(168, 168, 168, 255), /* button highlight */
|
||||||
};
|
};
|
||||||
|
|
||||||
CC_NOINLINE static void Launcher_GetCol(const char* key, BitmapCol* col) {
|
CC_NOINLINE static void Launcher_GetCol(const char* key, BitmapCol* col) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user