These are general things and not specific to TigerVNC, so let's move it to the fltk specific directory for clarity.pull/1529/head
@@ -5,6 +5,7 @@ include_directories(${CMAKE_SOURCE_DIR}/common) | |||
add_executable(vncviewer | |||
fltk/MonitorArrangement.cxx | |||
fltk/theme.cxx | |||
menukey.cxx | |||
BaseTouchHandler.cxx | |||
CConn.cxx |
@@ -0,0 +1,57 @@ | |||
/* Copyright 2011-2022 Pierre Ossman for Cendio AB | |||
* | |||
* Permission is hereby granted, free of charge, to any person obtaining | |||
* a copy of this software and associated documentation files (the | |||
* "Software"), to deal in the Software without restriction, including | |||
* without limitation the rights to use, copy, modify, merge, publish, | |||
* distribute, sublicense, and/or sell copies of the Software, and to | |||
* permit persons to whom the Software is furnished to do so, subject to | |||
* the following conditions: | |||
* | |||
* The above copyright notice and this permission notice shall be | |||
* included in all copies or substantial portions of the Software. | |||
* | |||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | |||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | |||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | |||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | |||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |||
* SOFTWARE. | |||
*/ | |||
#ifdef HAVE_CONFIG_H | |||
#include <config.h> | |||
#endif | |||
#include <FL/Fl.H> | |||
#include <FL/Fl_Widget.H> | |||
#include <FL/fl_ask.H> | |||
#include "theme.h" | |||
void init_theme() | |||
{ | |||
// Basic text size (10pt @ 96 dpi => 13px) | |||
FL_NORMAL_SIZE = 13; | |||
// Select a FLTK scheme and background color that looks somewhat | |||
// close to modern systems | |||
Fl::scheme("gtk+"); | |||
Fl::background(220, 220, 220); | |||
// macOS has a slightly brighter default background though | |||
#ifdef __APPLE__ | |||
Fl::background(240, 240, 240); | |||
#endif | |||
// This makes the "icon" in dialogs rounded, which fits better | |||
// with the above schemes. | |||
fl_message_icon()->box(FL_UP_BOX); | |||
#ifdef WIN32 | |||
// Most "normal" Windows apps use this font for UI elements. | |||
Fl::set_font(FL_HELVETICA, "Tahoma"); | |||
#endif | |||
} |
@@ -0,0 +1,29 @@ | |||
/* Copyright 2022 Pierre Ossman for Cendio AB | |||
* | |||
* Permission is hereby granted, free of charge, to any person obtaining | |||
* a copy of this software and associated documentation files (the | |||
* "Software"), to deal in the Software without restriction, including | |||
* without limitation the rights to use, copy, modify, merge, publish, | |||
* distribute, sublicense, and/or sell copies of the Software, and to | |||
* permit persons to whom the Software is furnished to do so, subject to | |||
* the following conditions: | |||
* | |||
* The above copyright notice and this permission notice shall be | |||
* included in all copies or substantial portions of the Software. | |||
* | |||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | |||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | |||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | |||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | |||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | |||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |||
* SOFTWARE. | |||
*/ | |||
#ifndef __FLTK_THEME_H__ | |||
#define __FLTK_THEME_H__ | |||
void init_theme(); | |||
#endif |
@@ -60,13 +60,12 @@ | |||
#include <network/TcpSocket.h> | |||
#include <os/os.h> | |||
#include <FL/Fl.H> | |||
#include <FL/Fl_Widget.H> | |||
#include <FL/Fl_PNG_Image.H> | |||
#include <FL/Fl_Sys_Menu_Bar.H> | |||
#include <FL/fl_ask.H> | |||
#include <FL/x.H> | |||
#include "fltk/theme.h" | |||
#include "fltk/util.h" | |||
#include "i18n.h" | |||
#include "parameters.h" | |||
@@ -323,18 +322,8 @@ static const char* getlocaledir() | |||
} | |||
static void init_fltk() | |||
{ | |||
// Basic text size (10pt @ 96 dpi => 13px) | |||
FL_NORMAL_SIZE = 13; | |||
// Select a FLTK scheme and background color that looks somewhat | |||
// close to modern systems | |||
Fl::scheme("gtk+"); | |||
Fl::background(220, 220, 220); | |||
// macOS has a slightly brighter default background though | |||
#ifdef __APPLE__ | |||
Fl::background(240, 240, 240); | |||
#endif | |||
// Adjust look of FLTK | |||
init_theme(); | |||
// Proper Gnome Shell integration requires that we set a sensible | |||
// WM_CLASS for the window. | |||
@@ -395,21 +384,12 @@ static void init_fltk() | |||
delete icons[i]; | |||
#endif | |||
// This makes the "icon" in dialogs rounded, which fits better | |||
// with the above schemes. | |||
fl_message_icon()->box(FL_UP_BOX); | |||
// Turn off the annoying behaviour where popups track the mouse. | |||
fl_message_hotspot(false); | |||
// Avoid empty titles for popups | |||
fl_message_title_default(_("TigerVNC Viewer")); | |||
#ifdef WIN32 | |||
// Most "normal" Windows apps use this font for UI elements. | |||
Fl::set_font(FL_HELVETICA, "Tahoma"); | |||
#endif | |||
// FLTK exposes these so that we can translate them. | |||
fl_no = _("No"); | |||
fl_yes = _("Yes"); |