mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-13 09:35:23 -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);
|
||||
}
|
||||
|
||||
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-------------------------------------------------------*
|
||||
@ -118,9 +133,7 @@ static void LButton_DrawBackground(struct LButton* w) {
|
||||
}
|
||||
|
||||
static void LButton_DrawBorder(struct LButton* w) {
|
||||
BitmapCol black = BitmapCol_Make(0, 0, 0, 255);
|
||||
BitmapCol backCol = Launcher_Theme.ClassicBackground ? black : Launcher_Theme.ButtonBorderColor;
|
||||
|
||||
BitmapCol backCol = Launcher_Theme.ButtonBorderColor;
|
||||
Drawer2D_Clear(&Launcher_Framebuffer, backCol,
|
||||
w->x + xBorder, w->y,
|
||||
w->width - xBorder2, yBorder);
|
||||
@ -136,20 +149,20 @@ static void LButton_DrawBorder(struct LButton* w) {
|
||||
}
|
||||
|
||||
static void LButton_DrawHighlight(struct LButton* w) {
|
||||
BitmapCol activeCol = BitmapCol_Make(189, 198, 255, 255);
|
||||
BitmapCol inactiveCol = BitmapCol_Make(168, 168, 168, 255);
|
||||
BitmapCol highlightCol;
|
||||
BitmapCol activeCol = BitmapCol_Make(189, 198, 255, 255);
|
||||
BitmapCol col = Launcher_Theme.ButtonHighlightColor;
|
||||
|
||||
if (Launcher_Theme.ClassicBackground) {
|
||||
highlightCol = w->hovered ? activeCol : inactiveCol;
|
||||
Drawer2D_Clear(&Launcher_Framebuffer, highlightCol,
|
||||
if (w->hovered) col = activeCol;
|
||||
|
||||
Drawer2D_Clear(&Launcher_Framebuffer, col,
|
||||
w->x + xBorder2, w->y + yBorder,
|
||||
w->width - xBorder4, yBorder);
|
||||
Drawer2D_Clear(&Launcher_Framebuffer, highlightCol,
|
||||
Drawer2D_Clear(&Launcher_Framebuffer, col,
|
||||
w->x + xBorder, w->y + yBorder2,
|
||||
xBorder, w->height - yBorder4);
|
||||
} else if (!w->hovered) {
|
||||
Drawer2D_Clear(&Launcher_Framebuffer, Launcher_Theme.ButtonHighlightColor,
|
||||
Drawer2D_Clear(&Launcher_Framebuffer, col,
|
||||
w->x + xBorder2, w->y + yBorder,
|
||||
w->width - xBorder4, yBorder);
|
||||
}
|
||||
@ -246,7 +259,7 @@ void LBackend_DrawCheckbox(struct LCheckbox* w) {
|
||||
int y = w->y + w->height / 2 - size / 2;
|
||||
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);
|
||||
|
||||
if (w->selected) {
|
||||
Drawer2D_Clear(&Launcher_Framebuffer, col,
|
||||
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);
|
||||
DrawBoxBounds(col, w->x, w->y, w->width, w->height);
|
||||
} else {
|
||||
Launcher_ResetArea(w->x, w->y,
|
||||
w->width, yBorder);
|
||||
|
@ -366,11 +366,11 @@ const struct LauncherTheme Launcher_ModernTheme = {
|
||||
|
||||
const struct LauncherTheme Launcher_ClassicTheme = {
|
||||
true,
|
||||
BitmapCol_Make(153, 127, 172, 255), /* background WIP */
|
||||
BitmapCol_Make( 97, 81, 110, 255), /* button border WIP */
|
||||
BitmapCol_Make( 50, 50, 50, 255), /* background */
|
||||
BitmapCol_Make( 0, 0, 0, 255), /* button border */
|
||||
BitmapCol_Make(126, 136, 191, 255), /* active button */
|
||||
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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user