Changeset - r25327:7add0f18509e
[Not reviewed]
master
0 1 0
Peter Nelson - 3 years ago 2021-04-19 08:29:49
peter1138@openttd.org
Codechange: Use text lines instead of pixel height of font for link graph widgets.
1 file changed with 6 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/linkgraph/linkgraph_gui.cpp
Show inline comments
 
@@ -383,7 +383,8 @@ NWidgetBase *MakeSaturationLegendLinkGra
 
	NWidgetVertical *panel = new NWidgetVertical(NC_EQUALSIZE);
 
	for (uint i = 0; i < lengthof(LinkGraphOverlay::LINK_COLOURS); ++i) {
 
		NWidgetBackground * wid = new NWidgetBackground(WWT_PANEL, COLOUR_DARK_GREEN, i + WID_LGL_SATURATION_FIRST);
 
		wid->SetMinimalSize(50, FONT_HEIGHT_SMALL);
 
		wid->SetMinimalSize(50, 0);
 
		wid->SetMinimalTextLines(1, 0, FS_SMALL);
 
		wid->SetFill(1, 1);
 
		wid->SetResize(0, 0);
 
		panel->Add(wid);
 
@@ -403,14 +404,16 @@ NWidgetBase *MakeCargoesLegendLinkGraphG
 
			row = new NWidgetHorizontal(NC_EQUALSIZE);
 
		}
 
		NWidgetBackground * wid = new NWidgetBackground(WWT_PANEL, COLOUR_GREY, i + WID_LGL_CARGO_FIRST);
 
		wid->SetMinimalSize(25, FONT_HEIGHT_SMALL);
 
		wid->SetMinimalSize(25, 0);
 
		wid->SetMinimalTextLines(1, 0, FS_SMALL);
 
		wid->SetFill(1, 1);
 
		wid->SetResize(0, 0);
 
		row->Add(wid);
 
	}
 
	/* Fill up last row */
 
	for (uint i = 0; i < 4 - (NUM_CARGO - 1) % 5; ++i) {
 
		NWidgetSpacer *spc = new NWidgetSpacer(25, FONT_HEIGHT_SMALL);
 
		NWidgetSpacer *spc = new NWidgetSpacer(25, 0);
 
		spc->SetMinimalTextLines(1, 0, FS_SMALL);
 
		spc->SetFill(1, 1);
 
		spc->SetResize(0, 0);
 
		row->Add(spc);
0 comments (0 inline, 0 general)