Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:skyjake/Doomsday-Engine
- Loading branch information
Showing
36 changed files
with
793 additions
and
261 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/** @file margins.h Margin rules for widgets. | ||
* | ||
* @authors Copyright (c) 2013 Jaakko Keränen <jaakko.keranen@iki.fi> | ||
* | ||
* @par License | ||
* GPL: http://www.gnu.org/licenses/gpl.html | ||
* | ||
* <small>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, see: | ||
* http://www.gnu.org/licenses</small> | ||
*/ | ||
|
||
#ifndef DENG_CLIENT_UI_MARGINS_H | ||
#define DENG_CLIENT_UI_MARGINS_H | ||
|
||
#include <de/Rule> | ||
#include <de/DotPath> | ||
|
||
#include "../uidefs.h" | ||
|
||
namespace ui { | ||
|
||
/** | ||
* Margin rules for a widget. | ||
*/ | ||
class Margins | ||
{ | ||
public: | ||
DENG2_DEFINE_AUDIENCE(Change, void marginsChanged()) | ||
|
||
public: | ||
Margins(de::String const &defaultMargin = "gap"); | ||
|
||
void setLeft (de::DotPath const &leftMarginId); | ||
void setRight (de::DotPath const &rightMarginId); | ||
void setTop (de::DotPath const &topMarginId); | ||
void setBottom(de::DotPath const &bottomMarginId); | ||
void set (ui::Direction dir, de::DotPath const &marginId); | ||
void set (de::DotPath const &marginId); | ||
|
||
void setLeft (de::Rule const &rule); | ||
void setRight (de::Rule const &rule); | ||
void setTop (de::Rule const &rule); | ||
void setBottom(de::Rule const &rule); | ||
void set (ui::Direction dir, de::Rule const &rule); | ||
void set (de::Rule const &rule); | ||
|
||
de::Rule const &left() const; | ||
de::Rule const &right() const; | ||
de::Rule const &top() const; | ||
de::Rule const &bottom() const; | ||
|
||
/** | ||
* The "width" of the margins is the sum of the left and right margins. | ||
*/ | ||
de::Rule const &width() const; | ||
|
||
/** | ||
* The "height" of the margins is the sim of the top and bottom margins. | ||
*/ | ||
de::Rule const &height() const; | ||
|
||
de::Rule const &margin(ui::Direction dir) const; | ||
|
||
private: | ||
DENG2_PRIVATE(d) | ||
}; | ||
|
||
} // namespace ui | ||
|
||
#endif // DENG_CLIENT_UI_MARGINS_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.