]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/layout.cpp
Only pass key and navigation events to enabled widgets
[libs/gltk.git] / source / layout.cpp
index 02e1ec4479dd17643dbbc8056b8b578c8bac0adb..4048e1147ac9321ab2596d1441db26b102e55a82 100644 (file)
@@ -259,7 +259,7 @@ Layout::ConstraintType Layout::complement(ConstraintType type)
 void Layout::create_constraint(Widget &src, ConstraintType type, Widget &tgt, int sp)
 {
        if(&src==&tgt)
-               throw invalid_argument("&src==&tgt");
+               throw invalid_argument("Layout::create_constraint");
 
        Slot &src_slot = get_slot_for_widget(src);
        Slot &tgt_slot = get_slot_for_widget(tgt);
@@ -362,7 +362,7 @@ void Layout::solve_constraints(int dir, SolveMode mode)
        columns of a widget are its position and dimension, respectively.  The
        remaining three are slack columns; see below for their purposes. */
        LinearProgram linprog(n_active_slots*5+n_slack_vars[dir]+1);
-       float weight = slots.size();
+       float weight = slots.size()+1;
        unsigned k = n_active_slots*5;
        for(list<Slot *>::iterator i=slots.begin(); i!=slots.end(); ++i)
        {