From 536526185b2f85b9d0755d70a492fbe399807c95 Mon Sep 17 00:00:00 2001 From: default0 Date: Tue, 22 Dec 2015 15:47:19 +0100 Subject: [PATCH 1/2] Fix scrollbar of FileDialog not updating If you change the opened directory in the FileDialog and opened a directory with enough contents to require a scrollbar, the scrollbar would not show up until you first scrolled. This commit fixes this by updating the scrollbar whenever the displayed directory of the FileDialog changes. --- src/dlangui/dialogs/filedlg.d | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/dlangui/dialogs/filedlg.d b/src/dlangui/dialogs/filedlg.d index 7e1219eb..b7881fdd 100644 --- a/src/dlangui/dialogs/filedlg.d +++ b/src/dlangui/dialogs/filedlg.d @@ -227,6 +227,9 @@ class FileDialog : Dialog, CustomGridCellAdapter { _fileList.setCellText(2, i, toUTF32(sz)); _fileList.setCellText(3, i, toUTF32(date)); } + if(_fileList.height > 0) + _fileList.scrollTo(0, 0); + _fileList.autoFitColumnWidths(); _fileList.fillColumnWidth(1); if (selectionIndex >= 0) From 3e51ebbfbbfd36d5fa25d79846cd8784122f9ece Mon Sep 17 00:00:00 2001 From: alphaKAI Date: Wed, 23 Dec 2015 12:43:41 +0900 Subject: [PATCH 2/2] fix build error D does not allow default constructor and to declare some constructors for struct. It is because that, unfortunately, your code does not be permitted in D's structure. Correct Code: import std.stdio; struct T{ this(int v = 2){ writeln(v); } } void main(){ T s = T(1); } However, following code is not permitted. import std.stdio; struct T{ this(int v = 2){ writeln(v); } } void main(){ T t; // <- This definition occur build error. This definition call default constructor such as this() but T does not has this(). T s = T(30); } That's why your following code dose not permitted. struct glyph_gamma_table(int maxv = 65) { this(double gammaValue = 1.0) { gamma = gammaValue; } //... } __gshared glyph_gamma_table!65 _gamma65;// <- calling this() !!!!!! __gshared glyph_gamma_table!256 _gamma256;// <- calling this() !!!!! By the way I might found your miss. Your code is: gamma = gammaValue; But this is not properly in this place, I think. I guess that you intended to write as follows. gamma(gammaValue); I fixed as above. --- src/dlangui/graphics/fonts.d | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/dlangui/graphics/fonts.d b/src/dlangui/graphics/fonts.d index 2de46889..9bc55cb8 100644 --- a/src/dlangui/graphics/fonts.d +++ b/src/dlangui/graphics/fonts.d @@ -855,11 +855,11 @@ struct GlyphCache // maxv is 65 for win32 fonts, 256 for freetype import std.math; //--------------------------------- -struct glyph_gamma_table(int maxv = 65) +class glyph_gamma_table(int maxv = 65) { this(double gammaValue = 1.0) { - gamma = gammaValue; + gamma(gammaValue); } @property double gamma() { return _gamma; } @property void gamma(double g) { @@ -890,6 +890,6 @@ private: __gshared glyph_gamma_table!65 _gamma65; __gshared glyph_gamma_table!256 _gamma256; __gshared static this() { - _gamma65 = glyph_gamma_table!65(1.0); - _gamma256 = glyph_gamma_table!256(1.0); + _gamma65 = new glyph_gamma_table!65(1.0); + _gamma256 = new glyph_gamma_table!256(1.0); }