1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-26 09:37:56 +00:00
transmission/gtk/HigWorkarea.h
Charles Kerr 318d60b72d
refactor: fix sonarcloud "use enum class" code smells (#2590)
* refactor: prefer constexpr over enum for GUI_PAD values

* refactor: prefer constexpr over enum for PrefsDialog values

* refactor: prefer constexpr over enum for StatsDialog values

* refactor: use enum class for GtrUnicode types

* refactor: prefer constexpr over enum for BT peer msg codes

* refactor: use enum class for TrMakemetaResult

* refactor: prefer constexpr over enum for BT metadata message types

* refactor: use enum class for AwaitingBt

* refactor: use enum class for EncryptionPreference

* refactor: use enum class for TrFormat in rpcimpl

* refactor: prefer constexpr over enum for QApp intervals

* refactor: prefer constexpr over enum for tr_resume bitfields

* refactor: prefer constexpr over enum for Qt/TrFileModel bitfields

* refactor: remove obsolete TODO comment in announce-list
2022-02-08 20:25:19 -06:00

55 lines
1.8 KiB
C++

// This file Copyright © 2007-2022 Mnemosyne LLC.
// It may be used under GPLv2 (SPDX: GPL-2.0), GPLv3 (SPDX: GPL-3.0),
// or any future license endorsed by Mnemosyne LLC.
// License text can be found in the licenses/ folder.
#pragma once
#include <gtkmm.h>
#include <libtransmission/tr-macros.h>
/**
*** utility code for making dialog layout that follows the Gnome HIG.
*** see section 8.2.2, Visual Design > Window Layout > Dialogs.
**/
class HigWorkarea : public Gtk::Grid
{
public:
HigWorkarea();
TR_DISABLE_COPY_MOVE(HigWorkarea)
void add_section_divider(guint& row);
void add_section_title_widget(guint& row, Gtk::Widget& w);
void add_section_title(guint& row, Glib::ustring const& section_title);
void add_wide_tall_control(guint& row, Gtk::Widget& w);
void add_wide_control(guint& row, Gtk::Widget& w);
Gtk::CheckButton* add_wide_checkbutton(guint& row, Glib::ustring const& mnemonic_string, bool is_active);
void add_label_w(guint row, Gtk::Widget& label_widget);
Gtk::Label* add_tall_row(
guint& row,
Glib::ustring const& mnemonic_string,
Gtk::Widget& control,
Gtk::Widget* mnemonic_or_null_for_control = nullptr);
Gtk::Label* add_row(
guint& row,
Glib::ustring const& mnemonic_string,
Gtk::Widget& control,
Gtk::Widget* mnemonic_or_null_for_control = nullptr);
void add_row_w(
guint& row,
Gtk::Widget& label_widget,
Gtk::Widget& control,
Gtk::Widget* mnemonic_or_null_for_control = nullptr);
private:
void add_tall_control(guint row, Gtk::Widget& control);
void add_control(guint row, Gtk::Widget& control);
};
auto inline constexpr GUI_PAD_SMALL = int{ 3 };
auto inline constexpr GUI_PAD = int{ 6 };
auto inline constexpr GUI_PAD_BIG = int{ 12 };
auto inline constexpr GUI_PAD_LARGE = int{ 12 };