Box/Seperator widgets in launcher scale with DPI

This commit is contained in:
UnknownShadow200 2019-07-28 23:30:32 +10:00
parent 87e385d00a
commit 8c57e07132
5 changed files with 6 additions and 22 deletions

View file

@ -253,18 +253,6 @@ void Drawer2D_BmpCopy(Bitmap* dst, int x, int y, Bitmap* src) {
}
}
void Drawer2D_Rect(Bitmap* bmp, BitmapCol col, int x, int y, int width, int height) {
/* Box contents are (x+1,y+1,width-1,height-1) */
/* Then the box is surrounded by blended borders */
/* TODO: The pixels of corners is wrong.. */
Drawer2D_Clear(bmp, col, x + 1, y + 1, width - 1, height - 1);
Gradient_Blend(bmp, col, 128, x, y, width + 1, 1);
Gradient_Blend(bmp, col, 128, x, y + height, width + 1, 1);
Gradient_Blend(bmp, col, 128, x, y, 1, height + 1);
Gradient_Blend(bmp, col, 128, x + width, y, 1, height + 1);
}
void Drawer2D_Clear(Bitmap* bmp, BitmapCol col, int x, int y, int width, int height) {
BitmapCol* row;
int xx, yy;

View file

@ -60,9 +60,6 @@ CC_API void Drawer2D_BmpScaled(Bitmap* dst, int x, int y, int width, int height,
int scaleWidth, int scaleHeight);
/* Fills the given area using pixels from the source bitmap. */
CC_API void Drawer2D_BmpCopy(Bitmap* dst, int x, int y, Bitmap* src);
/* Fills the given area with the given colour, then draws blended borders around it. */
CC_API void Drawer2D_Rect(Bitmap* bmp, BitmapCol col, int x, int y, int width, int height);
/* Fills the area with the given colour. */
CC_API void Drawer2D_Clear(Bitmap* bmp, BitmapCol col, int x, int y, int width, int height);

View file

@ -292,8 +292,8 @@ static void ChooseModeScreen_Init(struct LScreen* s_) {
if (s->numWidgets) return;
s->widgets = s->_widgets;
LScreen_Label(s_, &s->lblTitle, "");
LScreen_Box(s_, &s->seps[0], 490, 1);
LScreen_Box(s_, &s->seps[1], 490, 1);
LScreen_Box(s_, &s->seps[0], 490, 2);
LScreen_Box(s_, &s->seps[1], 490, 2);
LScreen_Button(s_, &s->btnEnhanced, 145, 35, "Enhanced");
LScreen_Label(s_, &s->lblEnhanced[0], "&eEnables custom blocks, changing env");
@ -1538,8 +1538,8 @@ static void UpdatesScreen_Init(struct LScreen* s_) {
s->widgets = s->_widgets;
LScreen_Label(s_, &s->lblYour, "Your build: (unknown)");
LScreen_Box(s_, &s->seps[0], 320, 1);
LScreen_Box(s_, &s->seps[1], 320, 1);
LScreen_Box(s_, &s->seps[0], 320, 2);
LScreen_Box(s_, &s->seps[1], 320, 2);
LScreen_Label(s_, &s->lblRel, "Latest release: Checking..");
LScreen_Button(s_, &s->btnRel[0], 130, 35, "Direct3D 9");

View file

@ -575,8 +575,7 @@ void LLabel_SetText(struct LLabel* w, const String* text) {
*#########################################################################################################################*/
static void LBox_Draw(void* widget) {
struct LBox* w = (struct LBox*)widget;
Drawer2D_Rect(&Launcher_Framebuffer, w->Col, w->X, w->Y, w->Width, w->Height);
//Gradient_Blend(&Launcher_Framebuffer, w->Col, 128, w->X, w->Y, w->Width, w->Height);
Gradient_Blend(&Launcher_Framebuffer, w->Col, 128, w->X, w->Y, w->Width, w->Height);
}
static struct LWidgetVTABLE lbox_VTABLE = {

View file

@ -2575,7 +2575,7 @@ static void SpecialInputWidget_UpdateColString(struct SpecialInputWidget* w) {
for (i = 0; i < DRAWER2D_MAX_COLS; i++) {
if (i >= 'A' && i <= 'F') continue;
if (Drawer2D_Cols[i].A == 0) continue;
if (!Drawer2D_Cols[i].A) continue;
String_Append(&w->colString, '&'); String_Append(&w->colString, (char)i);
String_Append(&w->colString, '%'); String_Append(&w->colString, (char)i);