diff --git a/examples/example1/src/example1.d b/examples/example1/src/example1.d
index 11174d90..b511c042 100644
--- a/examples/example1/src/example1.d
+++ b/examples/example1/src/example1.d
@@ -421,7 +421,7 @@ extern (C) int UIAppMain(string[] args) {
// most of controls example
{
LinearLayout controls = new VerticalLayout("controls");
- controls.padding = Rect(5,5,5,5);
+ controls.padding = Rect(12.pointsToPixels,12.pointsToPixels,12.pointsToPixels,12.pointsToPixels);
HorizontalLayout line1 = new HorizontalLayout();
controls.addChild(line1);
@@ -522,6 +522,7 @@ extern (C) int UIAppMain(string[] args) {
grid.setRowTitle(y, to!dstring(y+1));
//grid.alignment = Align.Right;
grid.setColWidth(0, 30.pointsToPixels);
+ grid.autoFit();
import std.random;
import std.string;
for (int x = 0; x < 12; x++) {
diff --git a/src/dlangui/graphics/resources.d b/src/dlangui/graphics/resources.d
index 04cafa8a..b82dd74c 100644
--- a/src/dlangui/graphics/resources.d
+++ b/src/dlangui/graphics/resources.d
@@ -622,6 +622,8 @@ static if (BACKEND_CONSOLE) {
if (srcx < 0 || srcx >= _width || srcy < 0 || srcy >= _height)
return;
int index = srcy * _width + srcx;
+ if (_textColors[index].isFullyTransparentColor && _bgColors[index].isFullyTransparentColor)
+ return; // do not draw
buf.drawChar(dstx, dsty, _text[index], _textColors[index], _bgColors[index]);
}
diff --git a/src/dlangui/platforms/common/startup.d b/src/dlangui/platforms/common/startup.d
index f43027ee..7921acd6 100644
--- a/src/dlangui/platforms/common/startup.d
+++ b/src/dlangui/platforms/common/startup.d
@@ -214,11 +214,14 @@ extern (C) void initLogs() {
static import std.stdio;
debug {
Log.setFileLogger(new std.stdio.File("ui.log", "w"));
+ Log.i("Debug build. Logging to file ui.log");
+ Log.setLogLevel(LogLevel.Trace);
} else {
// no logging unless version ForceLogs is set
version(ForceLogs) {
Log.setFileLogger(new std.stdio.File("ui.log", "w"));
Log.i("Logging to file ui.log");
+ //Log.setLogLevel(LogLevel.Trace);
}
}
} else {
diff --git a/src/dlangui/widgets/grid.d b/src/dlangui/widgets/grid.d
index 3c2ee2f0..73d513d2 100644
--- a/src/dlangui/widgets/grid.d
+++ b/src/dlangui/widgets/grid.d
@@ -52,6 +52,7 @@ Authors: Vadim Lopatin, coolreader.org@gmail.com
*/
module dlangui.widgets.grid;
+import dlangui.core.config;
import dlangui.widgets.widget;
import dlangui.widgets.controls;
import dlangui.widgets.scroll;
@@ -1301,6 +1302,9 @@ class GridWidgetBase : ScrollWidgetBase, GridModelAdapter, MenuItemActionHandler
if (!colVisible(x))
continue;
Rect cellRect = cellRectScroll(x, y);
+ if (BACKEND_CONSOLE && phase == 1) {
+ cellRect.right--;
+ }
Rect clippedCellRect = cellRect;
if (x >= nscols && cellRect.left < nspixels.x)
clippedCellRect.left = nspixels.x; // clip scrolled left
@@ -1362,9 +1366,13 @@ class GridWidgetBase : ScrollWidgetBase, GridModelAdapter, MenuItemActionHandler
if (m < sz.x)
m = sz.x;
}
+ Log.d("measureColWidth ", x, " = ", m);
static if (BACKEND_GUI) {
if (m < 10)
m = 10; // TODO: use min size
+ } else {
+ if (m < 3)
+ m = 3; // TODO: use min size
}
return m;
}
@@ -1384,7 +1392,7 @@ class GridWidgetBase : ScrollWidgetBase, GridModelAdapter, MenuItemActionHandler
}
void autoFitColumnWidth(int i) {
- _colWidths[i] = (i < _headerCols && !_showRowHeaders) ? 0 : measureColWidth(i) + (BACKEND_CONSOLE ? 1 : 3.pointsToPixels);
+ _colWidths[i] = (i < _headerCols && !_showRowHeaders) ? 0 : measureColWidth(i) + (BACKEND_CONSOLE ? 3 : 3.pointsToPixels);
}
/// extend specified column width to fit client area if grid width
@@ -1416,6 +1424,7 @@ class GridWidgetBase : ScrollWidgetBase, GridModelAdapter, MenuItemActionHandler
void autoFit() {
autoFitColumnWidths();
autoFitRowHeights();
+ updateCumulativeSizes();
}
this(string ID = null, ScrollBarMode hscrollbarMode = ScrollBarMode.Visible, ScrollBarMode vscrollbarMode = ScrollBarMode.Visible) {
@@ -1423,7 +1432,7 @@ class GridWidgetBase : ScrollWidgetBase, GridModelAdapter, MenuItemActionHandler
_headerCols = 1;
_headerRows = 1;
_defRowHeight = BACKEND_CONSOLE ? 1 : pointsToPixels(16);
- _defColumnWidth = BACKEND_CONSOLE ? 5 : 100;
+ _defColumnWidth = BACKEND_CONSOLE ? 7 : 100;
_showColHeaders = true;
_showRowHeaders = true;
diff --git a/views/res/console_theme_default.xml b/views/res/console_theme_default.xml
index 9b00d195..18df4f2b 100644
--- a/views/res/console_theme_default.xml
+++ b/views/res/console_theme_default.xml
@@ -87,9 +87,18 @@
align="Center"
/>
+ textFlags="UnderlineHotKeys"
+ textColor="#FFFFFF"
+ margins="0,0,1,0"
+ padding="1,0,1,0"
+ >
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+