Merge branch 'dev' into favorites-gui

This commit is contained in:
Lawrence Lee
2023-02-03 21:58:34 -08:00
39 changed files with 1583 additions and 929 deletions

View File

@@ -494,20 +494,56 @@ public:
TextOrIcon (const Glib::ustring &filename, const Glib::ustring &labelTx, const Glib::ustring &tooltipTx);
};
class MyImageMenuItem final : public Gtk::MenuItem
/**
* Widget with image and label placed horizontally.
*/
class ImageAndLabel final : public Gtk::Box
{
private:
Gtk::Grid *box;
RTImage *image;
Gtk::Label *label;
void construct(Glib::ustring label, RTImage* image);
class Impl;
std::unique_ptr<Impl> pimpl;
public:
MyImageMenuItem (Glib::ustring label, Glib::ustring imageFileName);
MyImageMenuItem (Glib::ustring label, RTImage* image);
ImageAndLabel(const Glib::ustring& label, const Glib::ustring& imageFileName);
ImageAndLabel(const Glib::ustring& label, RTImage* image);
const RTImage* getImage() const;
const Gtk::Label* getLabel() const;
};
/**
* Menu item with an image and label.
*/
class MyImageMenuItemInterface
{
public:
virtual const Gtk::Label* getLabel() const = 0;
};
/**
* Basic image menu item.
*/
class MyImageMenuItem final : public Gtk::MenuItem, public MyImageMenuItemInterface
{
class Impl;
std::unique_ptr<Impl> pimpl;
public:
MyImageMenuItem (const Glib::ustring& label, const Glib::ustring& imageFileName);
MyImageMenuItem (const Glib::ustring& label, RTImage* image);
const RTImage *getImage () const;
const Gtk::Label* getLabel () const;
const Gtk::Label* getLabel() const override;
};
/**
* Image menu item with radio selector.
*/
class MyRadioImageMenuItem final : public Gtk::RadioMenuItem, public MyImageMenuItemInterface
{
class Impl;
std::unique_ptr<Impl> pimpl;
public:
MyRadioImageMenuItem(const Glib::ustring& label, RTImage* image, Gtk::RadioButton::Group& group);
const Gtk::Label* getLabel() const override;
};
class MyProgressBar final : public Gtk::ProgressBar