change up set status dialog

This commit is contained in:
ouwou 2023-11-27 02:48:34 -05:00
parent c61feb9f01
commit 50d99de060
3 changed files with 37 additions and 16 deletions

View File

@ -117,3 +117,11 @@
border: 1px solid #5865f2;
background-color: rgba(89, 102, 242, 0.5);
}
.set-status-dialog .dialog-vbox {
padding: 5px;
}
.set-status-dialog .dialog-action-area {
margin: 10px 5px 5px 5px;
}

View File

@ -1,17 +1,31 @@
#include "setstatus.hpp"
static const std::array feelings = {
"wonderful",
"splendiferous",
"delicious",
"outstanding",
"amazing",
"great",
"marvelous",
"superb",
"out of this world",
"stupendous",
"tip-top",
"horrible",
};
SetStatusDialog::SetStatusDialog(Gtk::Window &parent)
: Gtk::Dialog("Set Status", parent, true)
, m_layout(Gtk::ORIENTATION_VERTICAL)
, m_bottom(Gtk::ORIENTATION_HORIZONTAL)
, m_ok("OK")
, m_cancel("Cancel")
, m_bbox(Gtk::ORIENTATION_HORIZONTAL) {
set_default_size(300, 50);
, m_cancel("Cancel") {
set_default_size(350, 200);
get_style_context()->add_class("app-window");
get_style_context()->add_class("app-popup");
get_style_context()->add_class("set-status-dialog");
m_text.set_placeholder_text("Status text");
m_text.set_placeholder_text("I feel " + Glib::ustring(feelings[rand() % feelings.size()]) + "!");
m_status_combo.append("online", "Online");
m_status_combo.append("dnd", "Do Not Disturb");
@ -35,16 +49,17 @@ SetStatusDialog::SetStatusDialog(Gtk::Window &parent)
response(Gtk::RESPONSE_CANCEL);
});
m_bbox.pack_start(m_ok, Gtk::PACK_SHRINK);
m_bbox.pack_start(m_cancel, Gtk::PACK_SHRINK);
m_bbox.set_layout(Gtk::BUTTONBOX_END);
m_layout.pack_start(*Gtk::make_managed<Gtk::Label>("How are you, " + Abaddon::Get().GetDiscordClient().GetUserData().GetDisplayName() + "?", Gtk::ALIGN_START));
m_layout.pack_start(m_text);
m_layout.pack_start(*Gtk::make_managed<Gtk::Label>("Status", Gtk::ALIGN_START));
m_layout.pack_start(m_status_combo);
m_layout.pack_start(*Gtk::make_managed<Gtk::Label>("Activity", Gtk::ALIGN_START));
m_layout.pack_start(m_type_combo);
m_bottom.add(m_status_combo);
m_bottom.add(m_type_combo);
m_bottom.add(m_bbox);
m_layout.add(m_text);
m_layout.add(m_bottom);
get_content_area()->add(m_layout);
get_action_area()->pack_start(m_ok, Gtk::PACK_SHRINK);
get_action_area()->pack_start(m_cancel, Gtk::PACK_SHRINK);
get_action_area()->set_layout(Gtk::BUTTONBOX_START);
show_all_children();
}

View File

@ -8,14 +8,12 @@ public:
PresenceStatus GetStatusType() const;
std::string GetActivityName() const;
protected:
private:
Gtk::Box m_layout;
Gtk::Box m_bottom;
Gtk::Entry m_text;
Gtk::ComboBoxText m_status_combo;
Gtk::ComboBoxText m_type_combo;
Gtk::Button m_ok;
Gtk::Button m_cancel;
Gtk::ButtonBox m_bbox;
};