[vfrnav/f17] add gtkmm3 size allocation patch
sailer
sailer at fedoraproject.org
Fri Jul 6 16:43:56 UTC 2012
commit b48bd2b67c669b1022516fe6a68ab68bd367a6b5
Author: Thomas Sailer <t.sailer at alumni.ethz.ch>
Date: Fri Jul 6 18:43:41 2012 +0200
add gtkmm3 size allocation patch
vfrnav-0.9-gtk3sizealloc.patch | 271 ++++++++++++++++++++++++++++++++++++++++
vfrnav.spec | 7 +-
2 files changed, 277 insertions(+), 1 deletions(-)
---
diff --git a/vfrnav-0.9-gtk3sizealloc.patch b/vfrnav-0.9-gtk3sizealloc.patch
new file mode 100644
index 0000000..d4612c6
--- /dev/null
+++ b/vfrnav-0.9-gtk3sizealloc.patch
@@ -0,0 +1,271 @@
+diff -urN vfrnav-0.9-orig/flightdeck/flightdeckwindow.cc vfrnav-0.9/flightdeck/flightdeckwindow.cc
+--- vfrnav-0.9-orig/flightdeck/flightdeckwindow.cc 2012-07-06 00:13:23.000000000 +0200
++++ vfrnav-0.9/flightdeck/flightdeckwindow.cc 2012-07-06 17:16:51.000000000 +0200
+@@ -954,7 +954,7 @@
+ m_fpldbtreeview->set_headers_clickable();
+ Glib::RefPtr<Gtk::TreeSelection> selection = m_fpldbtreeview->get_selection();
+ selection->set_mode(Gtk::SELECTION_MULTIPLE);
+- selection->signal_changed().connect(sigc::mem_fun(*this, &FlightDeckWindow::fpldb_selection_changed));
++ m_fpldbselchangeconn = selection->signal_changed().connect(sigc::mem_fun(*this, &FlightDeckWindow::fpldb_selection_changed));
+ selection->set_select_function(sigc::mem_fun(*this, &FlightDeckWindow::fpldb_select_function));
+ }
+ if (m_fpldbloadbutton)
+@@ -1129,7 +1129,7 @@
+ //m_fplgpsimptreeview->set_headers_clickable();
+ Glib::RefPtr<Gtk::TreeSelection> selection = m_fplgpsimptreeview->get_selection();
+ selection->set_mode(Gtk::SELECTION_SINGLE);
+- selection->signal_changed().connect(sigc::mem_fun(*this, &FlightDeckWindow::fplgpsimppage_selection_changed));
++ m_fplgpsimpselchangeconn = selection->signal_changed().connect(sigc::mem_fun(*this, &FlightDeckWindow::fplgpsimppage_selection_changed));
+ }
+ if (m_fplgpsimpdrawingarea)
+ m_fplgpsimpdrawingarea->set_route(m_fplgpsimproute);
+@@ -1515,6 +1515,7 @@
+ m_logtreeview->columns_autosize();
+ }
+
++ //set_hide_titlebar_when_maximized(true);
+ set_menu_id(0);
+ }
+
+diff -urN vfrnav-0.9-orig/flightdeck/flightdeckwindow.h vfrnav-0.9/flightdeck/flightdeckwindow.h
+--- vfrnav-0.9-orig/flightdeck/flightdeckwindow.h 2012-07-06 00:07:40.000000000 +0200
++++ vfrnav-0.9/flightdeck/flightdeckwindow.h 2012-07-06 17:16:39.000000000 +0200
+@@ -2375,11 +2375,13 @@
+ fpldbcfmmode_t m_fpldbcfmmode;
+ typedef std::set<FPlanRoute::id_t> fpldbcfmids_t;
+ fpldbcfmids_t m_fpldbcfmids;
++ sigc::connection m_fpldbselchangeconn;
+ // Flight Plan GPS Import Page Variables
+ GPSImportWaypointListModelColumns m_fplgpsimpcolumns;
+ Glib::RefPtr<Gtk::ListStore> m_fplgpsimpstore;
+ FPlanRoute m_fplgpsimproute;
+ class FPLGPSImpQuery;
++ sigc::connection m_fplgpsimpselchangeconn;
+ // Documents Directory Page Variables
+ DocumentsDirectoryModelColumns m_docdircolumns;
+ Glib::RefPtr<Gtk::TreeStore> m_docdirstore;
+diff -urN vfrnav-0.9-orig/flightdeck/fpldirpage.cc vfrnav-0.9/flightdeck/fpldirpage.cc
+--- vfrnav-0.9-orig/flightdeck/fpldirpage.cc 2012-06-19 23:56:12.000000000 +0200
++++ vfrnav-0.9/flightdeck/fpldirpage.cc 2012-07-06 17:14:53.000000000 +0200
+@@ -525,11 +525,14 @@
+ {
+ if (!m_fpldbstore)
+ return;
++ m_fpldbselchangeconn.block();
+ m_fpldbstore->clear();
++ m_fpldbselchangeconn.unblock();
+ fpldb_selection_changed();
+ if (m_menuid != 201)
+ return;
+ if (m_engine) {
++ m_fpldbselchangeconn.block();
+ FPlanRoute::id_t id(-1);
+ if (m_sensors &&
+ m_sensors->get_configfile().has_group(cfggroup_mainwindow) &&
+@@ -550,8 +553,11 @@
+ }
+ ok = fpl.load_next_fp();
+ }
+- if (seliter && m_fpldbtreeview)
++ if (seliter && m_fpldbtreeview) {
+ m_fpldbtreeview->scroll_to_row(Gtk::TreePath(seliter));
++ }
++ m_fpldbselchangeconn.unblock();
++ fpldb_selection_changed();
+ }
+ fpldirpage_updatepos();
+ }
+diff -urN vfrnav-0.9-orig/flightdeck/fplgpsimppage.cc vfrnav-0.9/flightdeck/fplgpsimppage.cc
+--- vfrnav-0.9-orig/flightdeck/fplgpsimppage.cc 2012-07-02 03:12:52.000000000 +0200
++++ vfrnav-0.9/flightdeck/fplgpsimppage.cc 2012-07-06 17:19:18.000000000 +0200
+@@ -369,8 +369,11 @@
+
+ bool FlightDeckWindow::fplgpsimppage_updatemenu(void)
+ {
++ m_fplgpsimpselchangeconn.block();
+ if (m_fplgpsimpstore)
+ m_fplgpsimpstore->clear();
++ m_fplgpsimpselchangeconn.unblock();
++ fplgpsimppage_selection_changed();
+ if (m_coorddialog)
+ m_coorddialog->hide();
+ if (m_menuid < 202 || m_menuid >= 300 || !m_sensors || !m_fplgpsimpstore) {
+@@ -386,6 +389,7 @@
+ if (m_fplgpsimplabel)
+ m_fplgpsimplabel->set_markup("GPS Flight Plan Import: <b>" + sens->get_name() + "</b>");
+ Gtk::TreeIter seliter;
++ m_fplgpsimpselchangeconn.block();
+ for (unsigned int nr = 0; nr < m_fplgpsimproute.get_nrwpt(); ++nr) {
+ const FPlanWaypoint& wpt(m_fplgpsimproute[nr]);
+ Gtk::TreeIter iter(m_fplgpsimpstore->append());
+@@ -419,6 +423,12 @@
+ if (m_fplgpsimproute.get_curwpt() == nr + 1)
+ seliter = iter;
+ }
++ if (seliter && m_fplgpsimptreeview) {
++ Glib::RefPtr<Gtk::TreeSelection> selection = m_fplgpsimptreeview->get_selection();
++ if (selection)
++ selection->select(seliter);
++ m_fplgpsimptreeview->scroll_to_row(Gtk::TreePath(seliter));
++ }
+ if (m_fplgpsimpdrawingarea) {
+ m_fplgpsimpdrawingarea->set_renderer(VectorMapArea::renderer_vmap);
+ *m_fplgpsimpdrawingarea = m_navarea.map_get_drawflags();
+@@ -436,5 +446,7 @@
+ m_fplgpsimpdrawingarea->show();
+ m_fplgpsimpdrawingarea->redraw_route();
+ }
++ m_fplgpsimpselchangeconn.unblock();
++ fplgpsimppage_selection_changed();
+ return true;
+ }
+diff -urN vfrnav-0.9-orig/flightdeck/keyboarddlg.cc vfrnav-0.9/flightdeck/keyboarddlg.cc
+--- vfrnav-0.9-orig/flightdeck/keyboarddlg.cc 2012-07-05 21:59:43.000000000 +0200
++++ vfrnav-0.9/flightdeck/keyboarddlg.cc 2012-07-06 16:48:31.000000000 +0200
+@@ -53,8 +53,12 @@
+ << ") Entry: (" << ea.get_x() << ',' << ea.get_y() << ") (" << ea.get_width() << ',' << ea.get_height()
+ << ") Kbd: (" << kx << ',' << ky << ") (" << kw << ',' << kh << ')' << std::endl;
+ m_keyboarddialog->move(kx, ky);
++ m_keyboarddialog->set_skip_taskbar_hint(true);
+ m_keyboarddialog->raise();
+- return false;
++ m_keyboarddialog->set_accept_focus(true);
++ m_keyboarddialog->present();
++ m_keyboarddialog->get_window()->show();
++ return false;
+ }
+
+ bool FlightDeckWindow::onscreenkbd_focus_out_event(GdkEventFocus *event)
+diff -urN vfrnav-0.9-orig/flightdeck/senscfggps.cc vfrnav-0.9/flightdeck/senscfggps.cc
+--- vfrnav-0.9-orig/flightdeck/senscfggps.cc 2012-06-29 19:46:27.000000000 +0200
++++ vfrnav-0.9/flightdeck/senscfggps.cc 2012-07-06 18:19:05.000000000 +0200
+@@ -216,8 +216,8 @@
+
+ void FlightDeckWindow::GPSAzimuthElevation::get_preferred_width_vfunc(int& minimum_width, int& natural_width) const
+ {
+- minimum_width = 64;
+- natural_width = 128;
++ minimum_width = 256;
++ natural_width = 256;
+ }
+
+ void FlightDeckWindow::GPSAzimuthElevation::get_preferred_height_for_width_vfunc(int width, int& minimum_height, int& natural_height) const
+@@ -227,8 +227,8 @@
+
+ void FlightDeckWindow::GPSAzimuthElevation::get_preferred_height_vfunc(int& minimum_height, int& natural_height) const
+ {
+- minimum_height = 64;
+- natural_height = 128;
++ minimum_height = 256;
++ natural_height = 256;
+ }
+
+ void FlightDeckWindow::GPSAzimuthElevation::get_preferred_width_for_height_vfunc(int height, int& minimum_width, int& natural_width) const
+@@ -406,20 +406,19 @@
+
+ void FlightDeckWindow::GPSSignalStrength::get_preferred_width_vfunc(int& minimum_width, int& natural_width) const
+ {
+- minimum_width = 64;
+- natural_width = 128;
++ minimum_width = 256;
++ natural_width = 256;
+ }
+
+ void FlightDeckWindow::GPSSignalStrength::get_preferred_height_for_width_vfunc(int width, int& minimum_height, int& natural_height) const
+ {
+- minimum_height = width / 3;
+- natural_height = width / 2;
++ minimum_height = natural_height = std::min(width / 2, 256);
+ }
+
+ void FlightDeckWindow::GPSSignalStrength::get_preferred_height_vfunc(int& minimum_height, int& natural_height) const
+ {
+- minimum_height = 32;
+- natural_height = 64;
++ minimum_height = 256;
++ natural_height = 256;
+ }
+
+ void FlightDeckWindow::GPSSignalStrength::get_preferred_width_for_height_vfunc(int height, int& minimum_width, int& natural_width) const
+@@ -491,8 +490,20 @@
+
+ void FlightDeckWindow::GPSContainer::get_preferred_height_for_width_vfunc(int width, int& minimum_height, int& natural_height) const
+ {
+- minimum_height = width / 3;
+- natural_height = width / 2;
++ minimum_height = 0;
++ natural_height = 0;
++ if (m_children.empty())
++ return;
++ int width1(width / (int)m_children.size());
++ int mheight(0), nheight(0);
++ for (int i = 0; i < (int)m_children.size(); ++i) {
++ int mh(0), nh(0);
++ m_children[i]->get_preferred_height_for_width(width1, mh, nh);
++ mheight = std::max(mheight, mh);
++ nheight = std::max(nheight, nh);
++ }
++ minimum_height = mheight;
++ natural_height = nheight;
+ }
+
+ void FlightDeckWindow::GPSContainer::get_preferred_height_vfunc(int& minimum_height, int& natural_height) const
+diff -urN vfrnav-0.9-orig/flightdeck/ui/flightdeck.ui vfrnav-0.9/flightdeck/ui/flightdeck.ui
+--- vfrnav-0.9-orig/flightdeck/ui/flightdeck.ui 2012-07-06 00:20:58.000000000 +0200
++++ vfrnav-0.9/flightdeck/ui/flightdeck.ui 2012-07-06 15:02:08.000000000 +0200
+@@ -2240,6 +2240,7 @@
+ <object class="GtkWindow" id="flightdeckwindow">
+ <property name="can_focus">False</property>
+ <property name="title" translatable="yes">Flight Deck</property>
++ <property name="hide_titlebar_when_maximized">True</property>
+ <property name="icon_name">weather-few-clouds</property>
+ <child>
+ <object class="GtkVBox" id="mainvbox">
+diff -urN vfrnav-0.9-orig/src/aircraft.cc vfrnav-0.9/src/aircraft.cc
+--- vfrnav-0.9-orig/src/aircraft.cc 2012-07-05 21:59:43.000000000 +0200
++++ vfrnav-0.9/src/aircraft.cc 2012-07-06 18:35:01.000000000 +0200
+@@ -1837,7 +1837,7 @@
+ }
+ altmap_t::const_iterator it2(it1);
+ --it1;
+- double m2((rpm - it1->first) / (it2->first - it1->first));
++ double m2((da - it1->first) / (it2->first - it1->first));
+ double m1(1 - m2), mp1(mp), mp2(mp), rpm1(rpm), rpm2(rpm);
+ double tas1, fuelflow1, bhp1, tas2, fuelflow2, bhp2;
+ calculate(tas1, fuelflow1, bhp1, mp1, rpm1, it1);
+diff -urN vfrnav-0.9-orig/src/barostd.cc vfrnav-0.9/src/barostd.cc
+--- vfrnav-0.9-orig/src/barostd.cc 2012-07-05 22:06:24.000000000 +0200
++++ vfrnav-0.9/src/barostd.cc 2012-07-06 16:49:09.000000000 +0200
+@@ -6,9 +6,9 @@
+ { 288.15, 1013.25 },
+ { 216.65, 226.321 },
+ { 216.65, 54.7489 },
+- { 228.65, 8.68019 },
++ { 228.65, 8.68018 },
+ { 270.65, 1.10906 },
+- { 270.65, 0.669389 },
++ { 270.65, 0.669388 },
+ { 214.65, 0.0395642 },
+- { 186.946, 0.00373384 }
++ { 186.946, 0.00373383 }
+ };
+diff -urN vfrnav-0.9-orig/src/maps.cc vfrnav-0.9/src/maps.cc
+--- vfrnav-0.9-orig/src/maps.cc 2012-07-05 23:35:53.000000000 +0200
++++ vfrnav-0.9/src/maps.cc 2012-07-06 17:01:09.000000000 +0200
+@@ -530,7 +530,7 @@
+
+ if (update_nolock())
+ update_drawoffset();
+- if (true) {
++ if (false) {
+ ScreenCoord scscr(calc_image_drawoffset(m_screenbuf));
+ ScreenCoord scdraw(calc_image_drawoffset(m_drawbuf));
+ Rect gsrect;
+diff -urN vfrnav-0.9-orig/TODO vfrnav-0.9/TODO
+--- vfrnav-0.9-orig/TODO 2012-07-05 23:38:18.000000000 +0200
++++ vfrnav-0.9/TODO 2012-07-06 16:49:01.000000000 +0200
+@@ -16,4 +16,3 @@
+ - check airspace display
+ - check airway display
+ - get bluetooth GPS working
+-- pop-up keyboard on gnome does not work
diff --git a/vfrnav.spec b/vfrnav.spec
index c1e05fc..19b5627 100644
--- a/vfrnav.spec
+++ b/vfrnav.spec
@@ -1,12 +1,13 @@
Name: vfrnav
Version: 0.9
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: VFR Navigation
Group: Applications/Productivity
License: GPLv2+
URL: http://www.baycom.org/~tom/vfrnav
Source0: http://download.gna.org/vfrnav/%{name}-%{version}.tar.gz
+Patch0: vfrnav-0.9-gtk3sizealloc.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: gtkmm30-devel
@@ -57,6 +58,7 @@ for the VFR navigation application.
%prep
%setup -q
+%patch0 -p1
%build
%configure
@@ -160,6 +162,9 @@ rm -rf $RPM_BUILD_ROOT
%{_bindir}/vfrdbopenair
%changelog
+* Fri Jul 6 2012 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.9-2
+- gtkmm3 size allocation fixes
+
* Thu Jul 5 2012 Thomas Sailer <t.sailer at alumni.ethz.ch> - 0.9-1
- update to 0.9
More information about the scm-commits
mailing list