1
0
Fork 0

Codechange: make direct access to tooltip/widget_data protected

pull/13282/head
Rubidium 2025-01-03 10:07:04 +01:00 committed by rubidium42
parent e543768570
commit 532f7de1f8
2 changed files with 6 additions and 2 deletions

View File

@ -3142,7 +3142,7 @@ static bool IsAttributeWidgetPartType(WidgetType tp)
* @param dest NWidget to apply attribute to. * @param dest NWidget to apply attribute to.
* @pre NWidgetPart must be an attribute NWidgetPart. * @pre NWidgetPart must be an attribute NWidgetPart.
*/ */
static void ApplyNWidgetPartAttribute(const NWidgetPart &nwid, NWidgetBase *dest) void ApplyNWidgetPartAttribute(const NWidgetPart &nwid, NWidgetBase *dest)
{ {
switch (nwid.type) { switch (nwid.type) {
case WPT_RESIZE: { case WPT_RESIZE: {

View File

@ -400,14 +400,18 @@ public:
NWidgetDisplay disp_flags; ///< Flags that affect display and interaction with the widget. NWidgetDisplay disp_flags; ///< Flags that affect display and interaction with the widget.
Colours colour; ///< Colour of this widget. Colours colour; ///< Colour of this widget.
protected:
const WidgetID index; ///< Index of the nested widget (\c -1 means 'not used'). const WidgetID index; ///< Index of the nested widget (\c -1 means 'not used').
WidgetData widget_data; ///< Data of the widget. @see Widget::data WidgetData widget_data; ///< Data of the widget. @see Widget::data
StringID tool_tip; ///< Tooltip of the widget. @see Widget::tootips StringID tool_tip; ///< Tooltip of the widget. @see Widget::tool_tips
WidgetID scrollbar_index; ///< Index of an attached scrollbar. WidgetID scrollbar_index; ///< Index of an attached scrollbar.
TextColour highlight_colour; ///< Colour of highlight. TextColour highlight_colour; ///< Colour of highlight.
TextColour text_colour; ///< Colour of text within widget. TextColour text_colour; ///< Colour of text within widget.
FontSize text_size; ///< Size of text within widget. FontSize text_size; ///< Size of text within widget.
StringAlignment align; ///< Alignment of text/image within widget. StringAlignment align; ///< Alignment of text/image within widget.
/* This function constructs the widgets, so it should be able to write the variables. */
friend void ApplyNWidgetPartAttribute(const struct NWidgetPart &nwid, NWidgetBase *dest);
}; };
/** /**