Ejemplo n.º 1
0
Gobby::StatusBar::StatusBar(Gtk::Window& window,
                            const Folder& folder,
                            const Preferences& preferences):
	Gtk::HBox(false, 2), m_folder(folder), m_preferences(preferences),
	m_visible_messages(0), m_current_view(NULL), m_position_context_id(0)
{
	pack_end(m_bar_position, Gtk::PACK_SHRINK);
	m_bar_position.set_size_request(200, -1);
	m_bar_position.show();

	window.signal_window_state_event().connect(
		sigc::mem_fun(*this, &StatusBar::on_window_state_event));

	m_folder.signal_document_removed().connect(
		sigc::mem_fun(*this, &StatusBar::on_document_removed));
	m_folder.signal_document_changed().connect(
		sigc::mem_fun(*this, &StatusBar::on_document_changed));
	m_preferences.appearance.show_statusbar.signal_changed().connect(
		sigc::mem_fun(*this, &StatusBar::on_view_changed));

	// Initial update
	on_document_changed(m_folder.get_current_document());
	on_view_changed();
}
Ejemplo n.º 2
0
Gobby::StatusBar::StatusBar(const Folder& folder,
                            const Preferences& preferences):
	m_folder(folder), m_preferences(preferences),
	m_visible_messages(0), m_current_view(NULL)
{
	set_column_spacing(2);

	m_lbl_position.set_halign(Gtk::ALIGN_END);
	m_lbl_position.set_hexpand(true);
	m_lbl_position.set_margin_end(6);
	m_lbl_position.show();
	attach(m_lbl_position, 0, 0, 1, 1);

	m_folder.signal_document_removed().connect(
		sigc::mem_fun(*this, &StatusBar::on_document_removed));
	m_folder.signal_document_changed().connect(
		sigc::mem_fun(*this, &StatusBar::on_document_changed));
	m_preferences.appearance.show_statusbar.signal_changed().connect(
		sigc::mem_fun(*this, &StatusBar::on_view_changed));

	// Initial update
	on_document_changed(m_folder.get_current_document());
	on_view_changed();
}