From 060b85ffc3d92b94b444b29ee5b26a6e74636235 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Wed, 29 May 2013 23:21:46 +0300 Subject: [PATCH] Comment and style updates --- source/layout.cpp | 4 ++-- source/layout.h | 8 ++++++++ source/resources.h | 10 +++++----- source/widget.h | 23 ++++++++--------------- 4 files changed, 23 insertions(+), 22 deletions(-) diff --git a/source/layout.cpp b/source/layout.cpp index e9f9b40..3f03ab9 100644 --- a/source/layout.cpp +++ b/source/layout.cpp @@ -343,8 +343,8 @@ void Layout::solve_constraints(int dir, SolveMode mode) } { - /* Only allow the widget's dimension to increase. The geometry has - previously been set to the smallest allowable size. */ + /* Don't allow the widget's dimension to get below that determined + by autosizing. */ LinearProgram::Row row = linprog.add_row(); row[(*i)->index*5+1] = 1; row[(*i)->index*5+4] = -1; diff --git a/source/layout.h b/source/layout.h index 7ae3907..0ea47a1 100644 --- a/source/layout.h +++ b/source/layout.h @@ -140,8 +140,16 @@ public: void set_container(Container &); void set_margin(const Sides &); + + /** Sets the default spacing between widgets in bothg directions. */ void set_spacing(unsigned); + + /** Sets the default vertical spacing between widgets. Affects the ABOVE + and BELOW constraints. */ void set_row_spacing(unsigned); + + /** Sets the default horizontal spacing between widgets. Affects the + LEFT_OF and RIGHT_OF constraints. */ void set_column_spacing(unsigned); void add_widget(Widget &); diff --git a/source/resources.h b/source/resources.h index d83c208..87b8364 100644 --- a/source/resources.h +++ b/source/resources.h @@ -18,11 +18,6 @@ instance in constructor. */ class Resources: public DataFile::Collection { -private: - FS::Path path; - GL::Font *default_font; - DataFile::DirectorySource *dir_src; - public: class Loader: public Collection::Loader { @@ -36,6 +31,11 @@ public: void font(const std::string &); }; +private: + FS::Path path; + GL::Font *default_font; + DataFile::DirectorySource *dir_src; + public: Resources(); Resources(const FS::Path &); diff --git a/source/widget.h b/source/widget.h index 270d2a3..b00849c 100644 --- a/source/widget.h +++ b/source/widget.h @@ -56,9 +56,7 @@ protected: public: virtual ~Widget(); - /** - Returns the name of the widget class. Used for style lookup. - */ + /// Returns the name of the widget class. Used for style lookup. virtual const char *get_class() const { return "widget"; } void set_position(int, int); @@ -68,26 +66,21 @@ public: const Geometry &get_geometry() const { return geom; } protected: - /** - Sets the widget's parent Container. The widget must be unparented when - calling this function with a non-null parameter. - */ + /** Sets the widget's parent Container. The widget must be unparented when + calling this function with a non-null parameter. */ void set_parent(Container *); public: Container *get_parent() const { return parent; } - /** - Sets the widget style. The final style name is constructed by concatenating - the widget class and the style name with a dash. - */ + /** Sets the widget style. The name of the resource to be looked up is + constructed by concatenating the widget class and the style name with a + dash. */ void set_style(const std::string &); const Style &get_style() const { return *style; } protected: - /** - Gets a style object from the resource collection based on the class and - style names of the widget. - */ + /** Gets a style object from the resource collection based on the class and + style names of the widget. */ void update_style(); public: -- 2.43.0