diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:20:50 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:20:50 +0200 |
commit | 7e706cf64654aea466c059c307e5723e2423ed5d (patch) | |
tree | e85f0d28d7c81b6d21419fc38e1a654cca2212b1 /ui/column_attr.h | |
parent | 5.5 (diff) | |
download | FreeFileSync-7e706cf64654aea466c059c307e5723e2423ed5d.tar.gz FreeFileSync-7e706cf64654aea466c059c307e5723e2423ed5d.tar.bz2 FreeFileSync-7e706cf64654aea466c059c307e5723e2423ed5d.zip |
5.6
Diffstat (limited to 'ui/column_attr.h')
-rw-r--r-- | ui/column_attr.h | 57 |
1 files changed, 24 insertions, 33 deletions
diff --git a/ui/column_attr.h b/ui/column_attr.h index 517961f4..ed98f403 100644 --- a/ui/column_attr.h +++ b/ui/column_attr.h @@ -25,11 +25,12 @@ enum ColumnTypeRim struct ColumnAttributeRim { - ColumnAttributeRim() : type_(COL_TYPE_DIRECTORY), width_(0), visible_(false) {} - ColumnAttributeRim(ColumnTypeRim type, int width, bool visible) : type_(type), width_(width), visible_(visible) {} + ColumnAttributeRim() : type_(COL_TYPE_DIRECTORY), offset_(0), stretch_(0), visible_(false) {} + ColumnAttributeRim(ColumnTypeRim type, int offset, int stretch, bool visible) : type_(type), offset_(offset), stretch_(stretch), visible_(visible) {} ColumnTypeRim type_; - int width_; //negative value stretches proportionally! + int offset_; + int stretch_; bool visible_; }; @@ -39,26 +40,26 @@ namespace std::vector<ColumnAttributeRim> getDefaultColumnAttributesLeft() { std::vector<ColumnAttributeRim> attr; - attr.push_back(ColumnAttributeRim(COL_TYPE_FULL_PATH, 250, false)); - attr.push_back(ColumnAttributeRim(COL_TYPE_DIRECTORY, 200, false)); - attr.push_back(ColumnAttributeRim(COL_TYPE_REL_PATH, 200, true)); - attr.push_back(ColumnAttributeRim(COL_TYPE_FILENAME, 150, true)); - attr.push_back(ColumnAttributeRim(COL_TYPE_SIZE, 80, true)); - attr.push_back(ColumnAttributeRim(COL_TYPE_DATE, 112, false)); - attr.push_back(ColumnAttributeRim(COL_TYPE_EXTENSION, 60, false)); + attr.push_back(ColumnAttributeRim(COL_TYPE_FULL_PATH, 250, 0, false)); + attr.push_back(ColumnAttributeRim(COL_TYPE_DIRECTORY, 200, 0, false)); + attr.push_back(ColumnAttributeRim(COL_TYPE_REL_PATH, 200, 0, true)); + attr.push_back(ColumnAttributeRim(COL_TYPE_FILENAME, -280, 1, true)); //stretch to full width and substract sum of fixed size widths! + attr.push_back(ColumnAttributeRim(COL_TYPE_SIZE, 80, 0, true)); + attr.push_back(ColumnAttributeRim(COL_TYPE_DATE, 112, 0, false)); + attr.push_back(ColumnAttributeRim(COL_TYPE_EXTENSION, 60, 0, false)); return attr; } std::vector<ColumnAttributeRim> getDefaultColumnAttributesRight() { std::vector<ColumnAttributeRim> attr; - attr.push_back(ColumnAttributeRim(COL_TYPE_FULL_PATH, 250, false)); - attr.push_back(ColumnAttributeRim(COL_TYPE_DIRECTORY, 200, false)); - attr.push_back(ColumnAttributeRim(COL_TYPE_REL_PATH, 200, false)); //already shown on left side - attr.push_back(ColumnAttributeRim(COL_TYPE_FILENAME, 150, true)); - attr.push_back(ColumnAttributeRim(COL_TYPE_SIZE, 80, true)); - attr.push_back(ColumnAttributeRim(COL_TYPE_DATE, 112, false)); - attr.push_back(ColumnAttributeRim(COL_TYPE_EXTENSION, 60, false)); + attr.push_back(ColumnAttributeRim(COL_TYPE_FULL_PATH, 250, 0, false)); + attr.push_back(ColumnAttributeRim(COL_TYPE_DIRECTORY, 200, 0, false)); + attr.push_back(ColumnAttributeRim(COL_TYPE_REL_PATH, 200, 0, false)); //already shown on left side + attr.push_back(ColumnAttributeRim(COL_TYPE_FILENAME, -80, 1, true)); //stretch to full width and substract sum of fixed size widths! + attr.push_back(ColumnAttributeRim(COL_TYPE_SIZE, 80, 0, true)); + attr.push_back(ColumnAttributeRim(COL_TYPE_DATE, 112, 0, false)); + attr.push_back(ColumnAttributeRim(COL_TYPE_EXTENSION, 60, 0, false)); return attr; } } @@ -83,11 +84,12 @@ enum ColumnTypeNavi struct ColumnAttributeNavi { - ColumnAttributeNavi() : type_(COL_TYPE_NAVI_DIRECTORY), width_(0), visible_(false) {} - ColumnAttributeNavi(ColumnTypeNavi type, int width, bool visible) : type_(type), width_(width), visible_(visible) {} + ColumnAttributeNavi() : type_(COL_TYPE_NAVI_DIRECTORY), offset_(0), stretch_(0), visible_(false) {} + ColumnAttributeNavi(ColumnTypeNavi type, int offset, int stretch, bool visible) : type_(type), offset_(offset), stretch_(stretch), visible_(visible) {} ColumnTypeNavi type_; - int width_; //negative value stretches proportionally! + int offset_; + int stretch_; bool visible_; }; @@ -100,19 +102,8 @@ inline std::vector<ColumnAttributeNavi> getDefaultColumnAttributesNavi() { std::vector<ColumnAttributeNavi> attr; - - ColumnAttributeNavi newEntry; - - newEntry.type_ = COL_TYPE_NAVI_DIRECTORY; - newEntry.visible_ = true; - newEntry.width_ = -1; //stretch, old value: 280; - attr.push_back(newEntry); - - newEntry.type_ = COL_TYPE_NAVI_BYTES; - newEntry.visible_ = true; - newEntry.width_ = 60; //GTK needs a few pixels more - attr.push_back(newEntry); - + attr.push_back(ColumnAttributeNavi(COL_TYPE_NAVI_DIRECTORY, -60, 1, true)); //stretch to full width and substract sum of fixed size widths! + attr.push_back(ColumnAttributeNavi(COL_TYPE_NAVI_BYTES, 60, 0, true)); //GTK needs a few pixels width more return attr; } } |