glom r1759 - in branches/glom-1-8: . glom/relationships_overview po
- From: murrayc svn gnome org
- To: svn-commits-list gnome org
- Subject: glom r1759 - in branches/glom-1-8: . glom/relationships_overview po
- Date: Wed, 26 Nov 2008 10:41:05 +0000 (UTC)
Author: murrayc
Date: Wed Nov 26 10:41:05 2008
New Revision: 1759
URL: http://svn.gnome.org/viewvc/glom?rev=1759&view=rev
Log:
2008-11-26 Murray Cumming,,, <murrayc murrayc com>
* configure.in: Revert the dependency on libgda-4.0 I am not sure how
that got into this branch.
* glom/relationships_overview/dialog_relationships_overview.[h|cc]:
Respond to changes in the scrolledwindow adjustments to increase the
canvas size when the window size changes, so it is always big enough,
avoiding dead areas.
Bug #559157 (Iain Lane).
Modified:
branches/glom-1-8/ChangeLog
branches/glom-1-8/configure.in
branches/glom-1-8/glom/relationships_overview/dialog_relationships_overview.cc
branches/glom-1-8/glom/relationships_overview/dialog_relationships_overview.h
branches/glom-1-8/po/Makefile.in.in
Modified: branches/glom-1-8/configure.in
==============================================================================
--- branches/glom-1-8/configure.in (original)
+++ branches/glom-1-8/configure.in Wed Nov 26 10:41:05 2008
@@ -86,7 +86,7 @@
fi
# Do not require, goocanvas and gtksourceviewmm in client only mode
-REQUIRED_LIBS="bakery-2.6 >= 2.6.0 gtkmm-2.4 >= 2.10 gthread-2.0 libxslt >= 1.1.10 pygda-4.0 pygtk-2.0 >= 2.6.0 libgdamm-4.0 libgda-4.0 libgda-postgres-4.0 goocanvasmm-1.0 >= 0.12.0"
+REQUIRED_LIBS="bakery-2.6 >= 2.6.0 gtkmm-2.4 >= 2.10 gthread-2.0 libxslt >= 1.1.10 pygda-3.0 pygtk-2.0 >= 2.6.0 libgdamm-3.0 libgda-3.0 libgda-postgres-4.0 goocanvasmm-1.0 >= 0.12.0"
if test $enable_client_only != yes; then
REQUIRED_LIBS="$REQUIRED_LIBS gtksourceviewmm-2.0"
fi
Modified: branches/glom-1-8/glom/relationships_overview/dialog_relationships_overview.cc
==============================================================================
--- branches/glom-1-8/glom/relationships_overview/dialog_relationships_overview.cc (original)
+++ branches/glom-1-8/glom/relationships_overview/dialog_relationships_overview.cc Wed Nov 26 10:41:05 2008
@@ -39,7 +39,8 @@
Dialog_RelationshipsOverview::Dialog_RelationshipsOverview(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& refGlade)
: Gtk::Dialog(cobject),
m_menu(0),
- m_modified(false)
+ m_modified(false),
+ m_scrolledwindow_canvas(0)
{
m_refPageSetup = Gtk::PageSetup::create();
m_refSettings = Gtk::PrintSettings::create();
@@ -116,12 +117,13 @@
//Get the scolled window and add the canvas to it:
- Gtk::ScrolledWindow* scrolledwindow_canvas = 0;
- refGlade->get_widget("scrolledwindow_canvas", scrolledwindow_canvas);
+ m_scrolledwindow_canvas = 0;
+ refGlade->get_widget("scrolledwindow_canvas", m_scrolledwindow_canvas);
- scrolledwindow_canvas->add(m_canvas);
+ m_scrolledwindow_canvas->add(m_canvas);
m_canvas.show();
+ //Restore the previous window size, to avoid annoying the user:
if(m_last_size_x != 0 && m_last_size_y != 0 )
{
set_default_size(m_last_size_x, m_last_size_y);
@@ -133,6 +135,13 @@
m_canvas.add_item(m_group_lines);
m_group_lines->lower(); //Make sure that the lines are below the tables.
+ //Respond to changes of window size,
+ //so we always make the canvas bounds big enough:
+ m_scrolledwindow_canvas->get_hadjustment()->signal_changed().connect(
+ sigc::mem_fun(*this, &Dialog_RelationshipsOverview::on_scroll_value_changed) );
+ m_scrolledwindow_canvas->get_vadjustment()->signal_changed().connect(
+ sigc::mem_fun(*this, &Dialog_RelationshipsOverview::on_scroll_value_changed) );
+
setup_context_menu();
}
@@ -511,5 +520,33 @@
}
}
+
+void Dialog_RelationshipsOverview::on_scroll_value_changed()
+{
+ if(!m_scrolledwindow_canvas)
+ return;
+
+ double width = m_scrolledwindow_canvas->get_hadjustment()->get_page_size();
+ double height = m_scrolledwindow_canvas->get_vadjustment()->get_page_size();
+ double x = m_scrolledwindow_canvas->get_hadjustment()->get_value();
+ double y = m_scrolledwindow_canvas->get_vadjustment()->get_value();
+
+ //Make sure that the canvas bounds are as big as the scrollable area:
+ double old_left = 0;
+ double old_top = 0;
+ double old_right = 0;
+ double old_bottom = 0;
+ m_canvas.get_bounds(old_left, old_top, old_right, old_bottom);
+
+ const double old_height = old_bottom - old_top;
+ const double old_width = old_right - old_left;
+
+ if( (width > old_width) ||
+ (height > old_height) )
+ {
+ m_canvas.set_bounds(0, 0, width, height);
+ }
+}
+
} //namespace Glom
Modified: branches/glom-1-8/glom/relationships_overview/dialog_relationships_overview.h
==============================================================================
--- branches/glom-1-8/glom/relationships_overview/dialog_relationships_overview.h (original)
+++ branches/glom-1-8/glom/relationships_overview/dialog_relationships_overview.h Wed Nov 26 10:41:05 2008
@@ -29,6 +29,7 @@
#include <gtkmm/uimanager.h>
#include <gtkmm/menubar.h>
#include <gtkmm/printoperation.h>
+#include <gtkmm/scrolledwindow.h>
#include <gtkmm/toggleaction.h>
#include <libglademm.h>
#include <goocanvasmm/canvas.h>
@@ -71,6 +72,8 @@
void on_context_menu_edit_fields(const Glib::RefPtr<CanvasGroupDbTable>& table);
void on_context_menu_edit_relationships(const Glib::RefPtr<CanvasGroupDbTable>& table);
+ void on_scroll_value_changed();
+
Glib::RefPtr<CanvasGroupDbTable> get_table_group(const Glib::ustring& table_name);
Glib::RefPtr<Gtk::UIManager> m_refUIManager;
@@ -80,6 +83,7 @@
bool m_modified;
CanvasEditable m_canvas;
+ Gtk::ScrolledWindow* m_scrolledwindow_canvas;
//typedef std::map<Glib::RefPtr<Goocanvas::Item>, TableView*> type_map_item_tables;
//type_map_item_tables m_tables;
Modified: branches/glom-1-8/po/Makefile.in.in
==============================================================================
--- branches/glom-1-8/po/Makefile.in.in (original)
+++ branches/glom-1-8/po/Makefile.in.in Wed Nov 26 10:41:05 2008
@@ -54,16 +54,16 @@
ALL_LINGUAS = @ALL_LINGUAS@
-PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; fi)
+PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; else echo "$(ALL_LINGUAS)"; fi)
USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep ^$$lang$$ $(srcdir)/LINGUAS 2>/dev/null`" -o -n "`echo $$ALINGUAS|tr ' ' '\n'|grep ^$$lang$$`"; then printf "$$lang "; fi; done; fi)
USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)" -o -n "$(LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done)
-POFILES=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done)
+POFILES=$(shell LINGUAS="$(PO_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done)
-DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(POFILES)
-EXTRA_DISTFILES = POTFILES.skip Makevars LINGUAS
+DISTFILES = Makefile.in.in POTFILES.in $(POFILES)
+EXTRA_DISTFILES = ChangeLog POTFILES.skip Makevars LINGUAS
POTFILES = \
# This comment gets stripped out
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]