From f8fb24ff62f9356b2d9cfe6939445fdae3d9bc28 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Mon, 24 Nov 2008 21:37:46 +0000 Subject: [PATCH] Added dialog.hpp for global layout constants --- src/gui/Makefile.am | 1 + src/gui/dialogs/dialog.hpp | 39 ++++++++++++++++++++++++++ src/gui/dialogs/preferences-dialog.cpp | 5 ++-- src/gui/dialogs/render.cpp | 5 ++-- 4 files changed, 46 insertions(+), 4 deletions(-) create mode 100644 src/gui/dialogs/dialog.hpp diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index 6830f69fe..039f6756a 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -37,6 +37,7 @@ lumigui_SOURCES = \ $(lumigui_srcdir)/workspace/actions.hpp \ $(lumigui_srcdir)/workspace/workspace-window.cpp \ $(lumigui_srcdir)/workspace/workspace-window.hpp \ + $(lumigui_srcdir)/dialogs/dialog.hpp \ $(lumigui_srcdir)/dialogs/render.cpp \ $(lumigui_srcdir)/dialogs/render.hpp \ $(lumigui_srcdir)/dialogs/preferences-dialog.cpp \ diff --git a/src/gui/dialogs/dialog.hpp b/src/gui/dialogs/dialog.hpp new file mode 100644 index 000000000..d4a7d4fd7 --- /dev/null +++ b/src/gui/dialogs/dialog.hpp @@ -0,0 +1,39 @@ +/* + dialog.hpp - Definitions of globals for dialogs + + Copyright (C) Lumiera.org + 2008, Joel Holdsworth + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ +/** @file render.hpp + ** This file contains definitions of globals for dialogs + ** + */ + +#ifndef DIALOG_HPP +#define DIALOG_HPP + +namespace gui { +namespace dialogs { + +static const int BorderPadding = 5; +static const int BoxSpacing = 4; + +} // namespace dialogs +} // namespace gui + +#endif // DIALOG_HPP diff --git a/src/gui/dialogs/preferences-dialog.cpp b/src/gui/dialogs/preferences-dialog.cpp index 20baea7cf..dae928143 100644 --- a/src/gui/dialogs/preferences-dialog.cpp +++ b/src/gui/dialogs/preferences-dialog.cpp @@ -23,6 +23,7 @@ #include "../gtk-lumiera.hpp" #include "preferences-dialog.hpp" +#include "dialog.hpp" using namespace Gtk; @@ -44,8 +45,8 @@ PreferencesDialog::PreferencesDialog(Window &parent) : v_box->pack_start(notebook); // Configure the dialog - v_box->set_spacing(4); - set_border_width(5); + v_box->set_spacing(BoxSpacing); + set_border_width(BorderPadding); set_resizable(false); // Configure the Cancel and OK buttons diff --git a/src/gui/dialogs/render.cpp b/src/gui/dialogs/render.cpp index 773eb4c99..5afa00f76 100644 --- a/src/gui/dialogs/render.cpp +++ b/src/gui/dialogs/render.cpp @@ -23,6 +23,7 @@ #include "../gtk-lumiera.hpp" #include "render.hpp" +#include "dialog.hpp" using namespace Gtk; @@ -64,8 +65,8 @@ Render::Render(Window &parent) : v_box->pack_start(videoFrame); // Configure the dialog - v_box->set_spacing(4); - set_border_width(5); + v_box->set_spacing(BoxSpacing); + set_border_width(BorderPadding); set_resizable(false); // Configure the Cancel and Render buttons