make libs/widgets use/provide default window positon

We cannot extend this to gtkmm2ext base classes yet, because there a 1-way
dependency between libs/widgets and libs/gtkmm2ext. May have to move
UIConfigurationBase into gtkmm2ext to allow that
This commit is contained in:
Paul Davis 2025-11-18 11:30:09 -07:00
parent 76c33f4680
commit f70b59f349
3 changed files with 9 additions and 3 deletions

View file

@ -18,7 +18,9 @@
*/
#include <ytkmm/label.h>
#include <widgets/choice.h>
#include "widgets/choice.h"
#include "widgets/ui_config.h"
using namespace std;
using namespace sigc;
@ -34,7 +36,7 @@ Choice::Choice (string title, string prompt, vector<string> choices, bool center
if (center) {
set_position (Gtk::WIN_POS_CENTER);
} else {
set_position (Gtk::WIN_POS_MOUSE);
set_position (UIConfigurationBase::instance().get_default_window_position());
}
set_name ("ChoiceWindow");

View file

@ -165,7 +165,7 @@ TearOff::tear_it_off ()
own_window.set_name (get_name());
close_event_box.set_name (get_name());
if (own_window_width == 0) {
own_window.set_position (WIN_POS_MOUSE);
own_window.set_position (UIConfigurationBase::instance().get_default_window_position());
}
own_window.show_all ();
own_window.present ();

View file

@ -23,6 +23,8 @@
#include <pangomm/fontdescription.h>
#include "ytkmm/enums.h"
#include "pbd/configuration.h"
#include "gtkmm2ext/colors.h"
@ -52,6 +54,8 @@ public:
virtual Pango::FontDescription get_NormalMonospaceFont () const = 0;
virtual Pango::FontDescription get_SmallMonospaceFont () const = 0;
virtual Pango::FontDescription get_ArdourSmallFont () const = 0;
virtual Gtk::WindowPosition get_default_window_position() const = 0;
};
}