Initial commit for real hidpi support

Note: This commit has only been tested on MacOS

Changes:
- Icons now use the native hidpi support from Gtk (through Icon Theme)
- Icons are now directly generated from scalable file (i.e. SVG file)
- Widget sizes are scaled based on DPI and scale factor
- Font size is scaled based on DPI and scale factor
This commit is contained in:
Pandagrapher
2022-08-19 16:47:28 +02:00
parent 1e2dc30738
commit 89d2bdce5b
108 changed files with 1949 additions and 2032 deletions

View File

@@ -191,11 +191,11 @@ public:
typedef sigc::signal<void> type_signal_enabled_toggled;
private:
type_signal_enabled_toggled message;
static Glib::RefPtr<RTImage> inconsistentImage; /// "inconsistent" image, displayed when useEnabled is true ; in this case, nothing will tell that an expander is opened/closed
static Glib::RefPtr<RTImage> enabledImage; /// "enabled" image, displayed when useEnabled is true ; in this case, nothing will tell that an expander is opened/closed
static Glib::RefPtr<RTImage> disabledImage; /// "disabled" image, displayed when useEnabled is true ; in this case, nothing will tell that an expander is opened/closed
static Glib::RefPtr<RTImage> openedImage; /// "opened" image, displayed when useEnabled is false
static Glib::RefPtr<RTImage> closedImage; /// "closed" image, displayed when useEnabled is false
const Glib::ustring inconsistentImage; /// "inconsistent" image, displayed when useEnabled is true ; in this case, nothing will tell that an expander is opened/closed
const Glib::ustring enabledImage; /// "enabled" image, displayed when useEnabled is true ; in this case, nothing will tell that an expander is opened/closed
const Glib::ustring disabledImage; /// "disabled" image, displayed when useEnabled is true ; in this case, nothing will tell that an expander is opened/closed
const Glib::ustring openedImage; /// "opened" image, displayed when useEnabled is false
const Glib::ustring closedImage; /// "closed" image, displayed when useEnabled is false
bool enabled; /// Enabled feature (default to true)
bool inconsistent; /// True if the enabled button is inconsistent
Gtk::EventBox *titleEvBox; /// EventBox of the title, to get a connector from it
@@ -238,10 +238,6 @@ public:
*/
MyExpander(bool useEnabled, Gtk::Widget* titleWidget);
/// Initialize the class by loading the images
static void init();
static void cleanup();
Glib::SignalProxy1< bool, GdkEventButton* > signal_button_release_event()
{
return titleEvBox->signal_button_release_event();
@@ -479,7 +475,7 @@ class TextOrIcon final : public Gtk::Box
{
public:
TextOrIcon (const Glib::ustring &filename, const Glib::ustring &labelTx, const Glib::ustring &tooltipTx);
TextOrIcon (const Glib::ustring &icon_name, const Glib::ustring &labelTx, const Glib::ustring &tooltipTx);
};
class MyImageMenuItem final : public Gtk::MenuItem
@@ -490,7 +486,7 @@ private:
Gtk::Label *label;
public:
MyImageMenuItem (Glib::ustring label, Glib::ustring imageFileName);
MyImageMenuItem (Glib::ustring label, Glib::ustring iconName);
const RTImage *getImage () const;
const Gtk::Label* getLabel () const;
};