Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ext/nanobind
Submodule nanobind updated 158 files
6 changes: 3 additions & 3 deletions include/nanogui/button.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ NAMESPACE_BEGIN(nanogui)
class NANOGUI_EXPORT Button : public Widget {
public:
/// Flags to specify the button behavior (can be combined with binary OR)
enum Flags {
enum Flags : int32_t{
NormalButton = (1 << 0), ///< A normal button.
RadioButton = (1 << 1), ///< A radio button.
ToggleButton = (1 << 2), ///< A toggle button.
Expand Down Expand Up @@ -79,7 +79,7 @@ class NANOGUI_EXPORT Button : public Widget {
/// The current flags of this Button (see \ref nanogui::Button::Flags for options).
int flags() const { return m_flags; }
/// Sets the flags of this Button (see \ref nanogui::Button::Flags for options).
void set_flags(int button_flags) { m_flags = button_flags; }
void set_flags(const Flags button_flags) { m_flags = button_flags; }

/// The position of the icon for this Button.
IconPosition icon_position() const { return m_icon_position; }
Expand Down Expand Up @@ -137,7 +137,7 @@ class NANOGUI_EXPORT Button : public Widget {
bool m_pushed;

/// The current flags of this button (see \ref nanogui::Button::Flags for options).
int m_flags;
Flags m_flags;

/// The background color of this Button.
Color m_background_color;
Expand Down
2 changes: 1 addition & 1 deletion include/nanogui/toolbutton.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class ToolButton : public Button {
ToolButton(Widget *parent, int icon,
const std::string &caption = "")
: Button(parent, caption, icon) {
set_flags(Flags::RadioButton | Flags::ToggleButton);
set_flags(static_cast<Flags>(Flags::RadioButton | Flags::ToggleButton));
set_fixed_size(Vector2i(25, 25));
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/popupbutton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ PopupButton::PopupButton(Widget *parent, const std::string &caption, int button_

m_chevron_icon = m_theme->m_popup_chevron_right_icon;

set_flags(Flags::ToggleButton | Flags::PopupButton);
set_flags(static_cast<Flags>(Flags::ToggleButton | Flags::PopupButton));

m_popup = new Popup(screen(), window());
m_popup->set_size(Vector2i(320, 250));
Expand Down