Merge branch 'master' into jgrpp
# Conflicts: # .github/workflows/release-windows.yml # src/company_base.h # src/company_cmd.cpp # src/company_gui.cpp # src/console_cmds.cpp # src/economy.cpp # src/economy_cmd.h # src/fios.h # src/goal.cpp # src/group_gui.cpp # src/network/core/config.h # src/network/network_admin.cpp # src/newgrf_config.cpp # src/os/windows/win32.cpp # src/saveload/afterload.cpp # src/saveload/company_sl.cpp # src/saveload/saveload.cpp # src/saveload/saveload_error.hpp # src/settings_gui.cpp # src/ship_cmd.cpp # src/stdafx.h # src/story.cpp # src/story_base.h # src/string.cpp # src/table/settings/economy_settings.ini # src/tests/CMakeLists.txt # src/tests/math_func.cpp
This commit is contained in:
@@ -92,7 +92,7 @@ enum WidgetType : uint8 {
|
||||
WPT_DATATIP, ///< Widget part for specifying data and tooltip.
|
||||
WPT_PADDING, ///< Widget part for specifying a padding.
|
||||
WPT_PIPSPACE, ///< Widget part for specifying pre/inter/post space for containers.
|
||||
WPT_TEXTCOLOUR, ///< Widget part for specifying text colour.
|
||||
WPT_TEXTSTYLE, ///< Widget part for specifying text colour.
|
||||
WPT_ALIGNMENT, ///< Widget part for specifying text/image alignment.
|
||||
WPT_ENDCONTAINER, ///< Widget part to denote end of a container.
|
||||
WPT_FUNCTION, ///< Widget part for calling a user function.
|
||||
@@ -340,7 +340,7 @@ public:
|
||||
void SetIndex(int index);
|
||||
void SetDataTip(uint32 widget_data, StringID tool_tip);
|
||||
void SetToolTip(StringID tool_tip);
|
||||
void SetTextColour(TextColour colour);
|
||||
void SetTextStyle(TextColour colour, FontSize size);
|
||||
void SetAlignment(StringAlignment align);
|
||||
|
||||
inline void SetLowered(bool lowered);
|
||||
@@ -363,6 +363,7 @@ public:
|
||||
int scrollbar_index; ///< Index of an attached scrollbar.
|
||||
TextColour highlight_colour; ///< Colour of highlight.
|
||||
TextColour text_colour; ///< Colour of text within widget.
|
||||
FontSize text_size; ///< Size of text within widget.
|
||||
StringAlignment align; ///< Alignment of text/image within widget.
|
||||
};
|
||||
|
||||
@@ -974,8 +975,9 @@ struct NWidgetPartTextLines {
|
||||
* Widget part for storing text colour.
|
||||
* @ingroup NestedWidgetParts
|
||||
*/
|
||||
struct NWidgetPartTextColour {
|
||||
struct NWidgetPartTextStyle {
|
||||
TextColour colour; ///< TextColour for DrawString.
|
||||
FontSize size; ///< Font size of text.
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -1007,7 +1009,7 @@ struct NWidgetPart {
|
||||
NWidgetPartPaddings padding; ///< Part with paddings.
|
||||
NWidgetPartPIP pip; ///< Part with pre/inter/post spaces.
|
||||
NWidgetPartTextLines text_lines; ///< Part with text line data.
|
||||
NWidgetPartTextColour colour; ///< Part with text colour data.
|
||||
NWidgetPartTextStyle text_style; ///< Part with text style data.
|
||||
NWidgetPartAlignment align; ///< Part with internal alignment.
|
||||
NWidgetFunctionType *func_ptr; ///< Part with a function call.
|
||||
NWidContainerFlags cont_flags; ///< Part with container flags.
|
||||
@@ -1068,16 +1070,18 @@ static inline NWidgetPart SetMinimalTextLines(uint8 lines, uint8 spacing, FontSi
|
||||
}
|
||||
|
||||
/**
|
||||
* Widget part function for setting the text colour.
|
||||
* Widget part function for setting the text style.
|
||||
* @param colour Colour to draw string within widget.
|
||||
* @param size Font size to draw string within widget.
|
||||
* @ingroup NestedWidgetParts
|
||||
*/
|
||||
static inline NWidgetPart SetTextColour(TextColour colour)
|
||||
static inline NWidgetPart SetTextStyle(TextColour colour, FontSize size = FS_NORMAL)
|
||||
{
|
||||
NWidgetPart part;
|
||||
|
||||
part.type = WPT_TEXTCOLOUR;
|
||||
part.u.colour.colour = colour;
|
||||
part.type = WPT_TEXTSTYLE;
|
||||
part.u.text_style.colour = colour;
|
||||
part.u.text_style.size = size;
|
||||
|
||||
return part;
|
||||
}
|
||||
|
Reference in New Issue
Block a user