Skip to content

Commit

Permalink
Increase font size
Browse files Browse the repository at this point in the history
Modern systems generally use 11pt rather than the 10pt we're targeting.
Increase this to almost 11pt to fit better in. Going further looks a bit
odd because of all hard coded margins in FLTK.
  • Loading branch information
CendioOssman committed Jan 17, 2022
1 parent f8892a7 commit 260b82e
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 26 deletions.
2 changes: 1 addition & 1 deletion vncviewer/OptionsDialog.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ std::map<OptionsCallback*, void*> OptionsDialog::callbacks;
static std::set<OptionsDialog *> instances;

OptionsDialog::OptionsDialog()
: Fl_Window(580, 420, _("TigerVNC Options"))
: Fl_Window(620, 450, _("TigerVNC Options"))
{
int x, y;
Fl_Button *button;
Expand Down
30 changes: 15 additions & 15 deletions vncviewer/ServerDialog.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ static LogWriter vlog("ServerDialog");
const char* SERVER_HISTORY="tigervnc.history";

ServerDialog::ServerDialog()
: Fl_Window(300, 0, "TigerVNC"),
: Fl_Window(320, 0, "TigerVNC"),
usedDir(NULL)
{
int y;
Expand All @@ -67,51 +67,51 @@ ServerDialog::ServerDialog()
Fl_Box *divider;
Fl_Menu_Button *menu;

y = 20;
y = 24;

box = new Fl_Box(0, y, w(), tigervnc_icon.h());
box->align(FL_ALIGN_CENTER|FL_ALIGN_INSIDE|FL_ALIGN_IMAGE_NEXT_TO_TEXT);
box->box(FL_NO_BOX);
box->image(tigervnc_icon);
box->callback(handleAbout, this);
y += box->h() + 20;
y += box->h() + 24;

box = new Fl_Box(0, y, w(), 20);
box = new Fl_Box(0, y, w(), 24);
box->align(FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
box->box(FL_NO_BOX);
box->label(_("TigerVNC Viewer"));
box->labelsize(20);
box->labelsize(24);
box->labelfont(FL_BOLD);
y += box->h() + 6;

box = new Fl_Box(0, y, w(), 10);
box = new Fl_Box(0, y, w(), 12);
box->align(FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
box->box(FL_NO_BOX);
box->label(PACKAGE_VERSION);
box->labelsize(10);
y += box->h() + 40;
box->labelsize(12);
y += box->h() + 48;

y += INPUT_LABEL_OFFSET;
serverName = new Fl_Input_Choice(20, y, w() - 20*2,
serverName = new Fl_Input_Choice(24, y, w() - 24*2,
INPUT_HEIGHT, _("Server name:"));
serverName->align(FL_ALIGN_LEFT | FL_ALIGN_TOP);
y += INPUT_HEIGHT + 20;
y += INPUT_HEIGHT + 24;

divider = new Fl_Box(20, y, w() - 20*2, 2);
divider = new Fl_Box(24, y, w() - 24*2, 2);
divider->box(FL_THIN_DOWN_FRAME);
y += 2 + 20;
y += 2 + 24;

menu = new Fl_Menu_Button(20, y, BUTTON_HEIGHT, BUTTON_HEIGHT, "");
menu = new Fl_Menu_Button(24, y, 25, BUTTON_HEIGHT, "");
menu->add(_("Options..."), 0, handleOptions, this, FL_MENU_DIVIDER);
menu->add(_("Load..."), 0, handleLoad, this, 0);
menu->add(_("Save As..."), 0, handleSaveAs, this, FL_MENU_DIVIDER);
menu->add(_("About..."), 0, handleAbout, this, 0);

button = new Fl_Return_Button(w() - 20 - BUTTON_WIDTH,
button = new Fl_Return_Button(w() - 24 - BUTTON_WIDTH,
y, BUTTON_WIDTH, BUTTON_HEIGHT,
_("Connect"));
button->callback(handleConnect, this);
y += BUTTON_HEIGHT + 20;
y += BUTTON_HEIGHT + 24;

resizable(NULL);
size(w(), y);
Expand Down
14 changes: 7 additions & 7 deletions vncviewer/fltk_layout.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,14 @@ static inline void fltk_menu_add(Fl_Menu_ *menu, const char *text,

/**** MARGINS ****/

#define OUTER_MARGIN 10
#define INNER_MARGIN 10
#define OUTER_MARGIN 12
#define INNER_MARGIN 12

/* Tighter grouping of related fields */
#define TIGHT_MARGIN 5
#define TIGHT_MARGIN 6

/**** ADJUSTMENTS ****/
#define INDENT 20
#define INDENT 24

/**** FLTK WIDGETS ****/

Expand All @@ -133,11 +133,11 @@ static inline void fltk_menu_add(Fl_Menu_ *menu, const char *text,

/* Fl_Input */
#define INPUT_LABEL_OFFSET FL_NORMAL_SIZE
#define INPUT_HEIGHT 25
#define INPUT_HEIGHT 30

/* Fl_Button */
#define BUTTON_WIDTH 115
#define BUTTON_HEIGHT 27
#define BUTTON_WIDTH 132
#define BUTTON_HEIGHT 32

/* Fl_Round_Button */
#define RADIO_MIN_WIDTH (FL_NORMAL_SIZE + 5)
Expand Down
7 changes: 4 additions & 3 deletions vncviewer/vncviewer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -325,10 +325,11 @@ static const char* getlocaledir()

static void init_fltk()
{
// Basic text size (10pt @ 96 dpi => 13px)
// FIXME: This is small by modern standards, but:
// Basic text size (11pt @ 96 dpi => 14.666...px)
// FIXME: This is rounded down since there are some issues scaling
// fonts up in FLTK:
// https://github.com/fltk/fltk/issues/371
FL_NORMAL_SIZE = 13;
FL_NORMAL_SIZE = 14;

// Select a FLTK scheme and background color that looks somewhat
// close to modern systems
Expand Down

0 comments on commit 260b82e

Please sign in to comment.