diff --git a/src/commands/cmd_about.cpp b/src/commands/cmd_about.cpp index 6d9cc2404..efdb35f60 100644 --- a/src/commands/cmd_about.cpp +++ b/src/commands/cmd_about.cpp @@ -87,7 +87,7 @@ void AboutCommand::execute(Context* context) jwidget_magnetic(button1, true); - jwidget_set_border(box1, 4, 4, 4, 4); + jwidget_set_border(box1, 4 * jguiscale()); jwidget_add_children(box1, label1, label2, separator1, NULL); if (textbox) { jview_attach(view, textbox); @@ -103,9 +103,9 @@ void AboutCommand::execute(Context* context) jwidget_add_child(window, box1); jwidget_set_border(button1, - button1->border_width.l+16, + button1->border_width.l + 16*jguiscale(), button1->border_width.t, - button1->border_width.r+16, + button1->border_width.r + 16*jguiscale(), button1->border_width.b); window->open_window_fg(); diff --git a/src/dialogs/tips.cpp b/src/dialogs/tips.cpp index 7b700db23..7b2fdd35f 100644 --- a/src/dialogs/tips.cpp +++ b/src/dialogs/tips.cpp @@ -341,7 +341,7 @@ static JWidget tips_load_box(FILE *f, char *buf, int sizeof_buf, int *take) { JWidget vbox = jbox_new(JI_VERTICAL); - jwidget_set_border(vbox, 2, 2, 2, 2); + jwidget_set_border(vbox, 2 * jguiscale()); for (;;) { if (*take) { diff --git a/src/jinete/jcombobox.cpp b/src/jinete/jcombobox.cpp index 5ae7c2d24..68a6c0eec 100644 --- a/src/jinete/jcombobox.cpp +++ b/src/jinete/jcombobox.cpp @@ -333,8 +333,11 @@ static bool combobox_msg_proc(JWidget widget, JMessage msg) /* get the text-length of every item and put in 'w' the maximum value */ JI_LIST_FOR_EACH(combobox->items, link) { - int item_w = 2+text_length(widget->getFont(), - ((ComboItem *)link->data)->text)+2; + int item_w = + 2*jguiscale()+ + text_length(widget->getFont(), + ((ComboItem *)link->data)->text)+ + 2*jguiscale(); w = MAX(w, item_w); } diff --git a/src/jinete/jpopup_window.cpp b/src/jinete/jpopup_window.cpp index 0c89dde7e..2bfc6c771 100644 --- a/src/jinete/jpopup_window.cpp +++ b/src/jinete/jpopup_window.cpp @@ -138,14 +138,14 @@ bool PopupWindow::msg_proc(JMessage msg) if (msg->signal.num == JI_SIGNAL_INIT_THEME) { int w = 0, h = 0; - this->border_width.l = 3; - this->border_width.t = 3; - this->border_width.r = 3; - this->border_width.b = 3; + this->border_width.l = 3 * jguiscale(); + this->border_width.t = 3 * jguiscale(); + this->border_width.r = 3 * jguiscale(); + this->border_width.b = 3 * jguiscale(); _ji_theme_textbox_draw(NULL, this, &w, &h, 0, 0); - this->border_width.t = h-3; + this->border_width.t = h - 3 * jguiscale(); /* setup the background color */ jwidget_set_bg_color(this, makecol(255, 255, 200)); @@ -202,7 +202,7 @@ bool PopupWindow::msg_proc(JMessage msg) jdraw_rectfill(pos, this->getBgColor()); oldt = this->border_width.t; - this->border_width.t = 3; + this->border_width.t = 3 * jguiscale(); _ji_theme_textbox_draw(ji_screen, this, NULL, NULL, this->getBgColor(), ji_color_foreground()); diff --git a/src/jinete/jtooltips.cpp b/src/jinete/jtooltips.cpp index 8f1110f51..a61dcb978 100644 --- a/src/jinete/jtooltips.cpp +++ b/src/jinete/jtooltips.cpp @@ -244,14 +244,14 @@ bool TipWindow::msg_proc(JMessage msg) if (msg->signal.num == JI_SIGNAL_INIT_THEME) { int w = 0, h = 0; - this->border_width.l = 3; - this->border_width.t = 3; - this->border_width.r = 3; - this->border_width.b = 3; + this->border_width.l = 3 * jguiscale(); + this->border_width.t = 3 * jguiscale(); + this->border_width.r = 3 * jguiscale(); + this->border_width.b = 3 * jguiscale(); _ji_theme_textbox_draw(NULL, this, &w, &h, 0, 0); - this->border_width.t = h-3; + this->border_width.t = h - 3 * jguiscale(); /* setup the background color */ setBgColor(makecol(255, 255, 200)); @@ -308,7 +308,7 @@ bool TipWindow::msg_proc(JMessage msg) jdraw_rectfill(pos, this->getBgColor()); oldt = this->border_width.t; - this->border_width.t = 3; + this->border_width.t = 3 * jguiscale(); _ji_theme_textbox_draw(ji_screen, this, NULL, NULL, this->getBgColor(), ji_color_foreground()); diff --git a/src/modules/skinneable_theme.cpp b/src/modules/skinneable_theme.cpp index 40c094eca..557d9a56a 100644 --- a/src/modules/skinneable_theme.cpp +++ b/src/modules/skinneable_theme.cpp @@ -327,12 +327,7 @@ static struct SkinneableTheme::SkinneableTheme() { - int scale = jguiscale(); - this->name = "Skinneable Theme"; - this->check_icon_size = 8 * scale; - this->radio_icon_size = 8 * scale; - this->scrollbar_size = 12 * scale; m_sheet_bmp = NULL; for (int c=0; cchild_spacing = 18 * scale; break; @@ -574,10 +573,10 @@ void SkinneableTheme::init_widget(JWidget widget) break; case JI_SLIDER: - BORDER4(m_part[PART_SLIDER_EMPTY_W]->w-1, + BORDER4(m_part[PART_SLIDER_EMPTY_W]->w-1*scale, m_part[PART_SLIDER_EMPTY_N]->h, - m_part[PART_SLIDER_EMPTY_E]->w-1, - m_part[PART_SLIDER_EMPTY_S]->h-1); + m_part[PART_SLIDER_EMPTY_E]->w-1*scale, + m_part[PART_SLIDER_EMPTY_S]->h-1*scale); widget->child_spacing = jwidget_get_text_height(widget); widget->setAlign(JI_CENTER | JI_MIDDLE); break; @@ -588,10 +587,10 @@ void SkinneableTheme::init_widget(JWidget widget) break; case JI_VIEW: - BORDER4(m_part[PART_SUNKEN_NORMAL_W]->w-1, + BORDER4(m_part[PART_SUNKEN_NORMAL_W]->w-1*scale, m_part[PART_SUNKEN_NORMAL_N]->h, - m_part[PART_SUNKEN_NORMAL_E]->w-1, - m_part[PART_SUNKEN_NORMAL_S]->h-1); + m_part[PART_SUNKEN_NORMAL_E]->w-1*scale, + m_part[PART_SUNKEN_NORMAL_S]->h-1*scale); widget->child_spacing = 0; break; @@ -1022,24 +1021,26 @@ void SkinneableTheme::draw_menuitem(JWidget widget, JRect clip) if (!bar) { /* draw the arrown (to indicate which this menu has a sub-menu) */ if (jmenuitem_get_submenu(widget)) { + int scale = jguiscale(); + /* enabled */ if (jwidget_is_enabled(widget)) { - for (c=0; c<3; c++) + for (c=0; c<3*scale; c++) vline(ji_screen, - widget->rc->x2-3-c, + widget->rc->x2-3*scale-c, (widget->rc->y1+widget->rc->y2)/2-c, (widget->rc->y1+widget->rc->y2)/2+c, fg); } /* disabled */ else { - for (c=0; c<3; c++) + for (c=0; c<3*scale; c++) vline(ji_screen, - widget->rc->x2-3-c+1, + widget->rc->x2-3*scale-c+1, (widget->rc->y1+widget->rc->y2)/2-c+1, (widget->rc->y1+widget->rc->y2)/2+c+1, COLOR_BACKGROUND); - for (c=0; c<3; c++) + for (c=0; c<3*scale; c++) vline(ji_screen, - widget->rc->x2-3-c, + widget->rc->x2-3*scale-c, (widget->rc->y1+widget->rc->y2)/2-c, (widget->rc->y1+widget->rc->y2)/2+c, COLOR_DISABLED); } @@ -1731,8 +1732,8 @@ bool SkinneableTheme::theme_combobox_button_msg_proc(JWidget widget, JMessage ms switch (msg->type) { case JM_REQSIZE: - msg->reqsize.w = 15; - msg->reqsize.h = 16; + msg->reqsize.w = 15 * jguiscale(); + msg->reqsize.h = 16 * jguiscale(); return true; } diff --git a/src/widgets/colsel.cpp b/src/widgets/colsel.cpp index dd09fe6e9..b6b583937 100644 --- a/src/widgets/colsel.cpp +++ b/src/widgets/colsel.cpp @@ -121,7 +121,7 @@ Frame* colorselector_new(bool editable_palette) /* data for a better layout */ grid1->child_spacing = 0; - grid2->border_width.t = 3; + grid2->border_width.t = 3 * jguiscale(); jwidget_expansive(grid2, true); /* append a tab for each color-model */ diff --git a/src/widgets/colview.cpp b/src/widgets/colview.cpp index 5295af0cc..b3f132a94 100644 --- a/src/widgets/colview.cpp +++ b/src/widgets/colview.cpp @@ -53,7 +53,7 @@ JWidget colorviewer_new(color_t color, int imgtype) jwidget_add_hook(widget, colorviewer_type(), colorviewer_msg_proc, colorviewer); jwidget_focusrest(widget, true); - jwidget_set_border(widget, 2, 2, 2, 2); + jwidget_set_border(widget, 2 * jguiscale()); widget->setAlign(JI_CENTER | JI_MIDDLE); return widget; diff --git a/src/widgets/paledit.cpp b/src/widgets/paledit.cpp index f5b525e7d..574acefeb 100644 --- a/src/widgets/paledit.cpp +++ b/src/widgets/paledit.cpp @@ -29,6 +29,7 @@ #include "jinete/jsystem.h" #include "jinete/jview.h" #include "jinete/jwidget.h" +#include "jinete/jtheme.h" #include "core/color.h" #include "modules/gui.h" @@ -74,9 +75,9 @@ JWidget paledit_new(Palette *palette, bool editable, int boxsize) jwidget_add_hook(widget, paledit_type(), paledit_msg_proc, paledit); jwidget_focusrest(widget, true); - widget->border_width.l = widget->border_width.r = 1; - widget->border_width.t = widget->border_width.b = 1; - widget->child_spacing = 1; + widget->border_width.l = widget->border_width.r = 1 * jguiscale(); + widget->border_width.t = widget->border_width.b = 1 * jguiscale(); + widget->child_spacing = 1 * jguiscale(); return widget; } diff --git a/src/widgets/target.cpp b/src/widgets/target.cpp index 3732d274a..ae124c113 100644 --- a/src/widgets/target.cpp +++ b/src/widgets/target.cpp @@ -24,6 +24,7 @@ #include "jinete/jbox.h" #include "jinete/jbutton.h" #include "jinete/jhook.h" +#include "jinete/jtheme.h" #include "jinete/jwidget.h" #include "core/cfg.h" @@ -47,7 +48,7 @@ JWidget target_button_new(int imgtype, bool with_channels) { #define ADD(box, widget, hook) \ if (widget) { \ - jwidget_set_border(widget, 2, 2, 2, 2); \ + jwidget_set_border(widget, 2 * jguiscale()); \ jwidget_add_child(box, widget); \ HOOK(widget, \ widget->type == JI_BUTTON ? \