Skip to content

Clean up LLUI and fix/add suggestions from VS #3933

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions indra/llui/llaccordionctrltab.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class LLAccordionCtrlTab : public LLUICtrl

void setSelected(bool is_selected);

bool getCollapsible() { return mCollapsible; };
bool getCollapsible() const { return mCollapsible; };

void setCollapsible(bool collapsible) { mCollapsible = collapsible; };
void changeOpenClose(bool is_open);
Expand Down Expand Up @@ -181,7 +181,7 @@ class LLAccordionCtrlTab : public LLUICtrl

void setHeaderVisible(bool value);

bool getHeaderVisible() { return mHeaderVisible;}
bool getHeaderVisible() const { return mHeaderVisible;}

S32 mExpandedHeight; // Height of expanded ctrl.
// Used to restore height after expand.
Expand Down
8 changes: 4 additions & 4 deletions indra/llui/llcheckboxctrl.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
// Constants
//

const bool RADIO_STYLE = true;
const bool CHECK_STYLE = false;
constexpr bool RADIO_STYLE = true;
constexpr bool CHECK_STYLE = false;

//
// Classes
Expand Down Expand Up @@ -94,7 +94,7 @@ class LLCheckBoxCtrl
// LLUICtrl interface
virtual void setValue(const LLSD& value );
virtual LLSD getValue() const;
bool get() { return (bool)getValue().asBoolean(); }
bool get() const { return (bool)getValue().asBoolean(); }
void set(bool value) { setValue(value); }

virtual void setTentative(bool b);
Expand All @@ -106,7 +106,7 @@ class LLCheckBoxCtrl
virtual void onCommit();

// LLCheckBoxCtrl interface
virtual bool toggle() { return mButton->toggleState(); } // returns new state
virtual bool toggle() { return mButton->toggleState(); } // returns new state

void setBtnFocus() { mButton->setFocus(true); }

Expand Down
18 changes: 9 additions & 9 deletions indra/llui/llcontainerview.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,21 +65,21 @@ class LLContainerView : public LLView
public:
~LLContainerView();

/*virtual*/ bool postBuild();
/*virtual*/ bool addChild(LLView* view, S32 tab_group = 0);
bool postBuild() override;
bool addChild(LLView* view, S32 tab_group = 0) override;

/*virtual*/ bool handleDoubleClick(S32 x, S32 y, MASK mask);
/*virtual*/ bool handleMouseDown(S32 x, S32 y, MASK mask);
/*virtual*/ bool handleMouseUp(S32 x, S32 y, MASK mask);
bool handleDoubleClick(S32 x, S32 y, MASK mask) override;
bool handleMouseDown(S32 x, S32 y, MASK mask) override;
bool handleMouseUp(S32 x, S32 y, MASK mask) override;

/*virtual*/ void draw();
/*virtual*/ void reshape(S32 width, S32 height, bool called_from_parent = true);
/*virtual*/ LLRect getRequiredRect(); // Return the height of this object, given the set options.
void draw() override;
void reshape(S32 width, S32 height, bool called_from_parent = true) override;
LLRect getRequiredRect() override; // Return the height of this object, given the set options.

void setLabel(const std::string& label);
void showLabel(bool show) { mShowLabel = show; }
void setDisplayChildren(bool displayChildren);
bool getDisplayChildren() { return mDisplayChildren; }
bool getDisplayChildren() const { return mDisplayChildren; }
void setScrollContainer(LLScrollContainer* scroll) {mScrollContainer = scroll;}

private:
Expand Down
4 changes: 2 additions & 2 deletions indra/llui/lldockablefloater.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ class LLDockableFloater : public LLFloater
virtual bool overlapsScreenChannel() { return mOverlapsScreenChannel && getVisible() && isDocked(); }
virtual void setOverlapsScreenChannel(bool overlaps) { mOverlapsScreenChannel = overlaps; }

bool getUniqueDocking() { return mUniqueDocking; }
bool getUseTongue() { return mUseTongue; }
bool getUniqueDocking() const { return mUniqueDocking; }
bool getUseTongue() const { return mUseTongue; }

void setUseTongue(bool use_tongue) { mUseTongue = use_tongue;}
private:
Expand Down
2 changes: 1 addition & 1 deletion indra/llui/lldockcontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ void LLDockControl::repositionDockable()
}
}

bool LLDockControl::isDockVisible()
bool LLDockControl::isDockVisible() const
{
bool res = true;

Expand Down
8 changes: 4 additions & 4 deletions indra/llui/lldockcontrol.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,19 @@ class LLDockControl
void off();
void forceRecalculatePosition();
void setDock(LLView* dockWidget);
LLView* getDock()
LLView* getDock() const
{
return mDockWidgetHandle.get();
}
void repositionDockable();
void drawToungue();
bool isDockVisible();
bool isDockVisible() const;

// gets a rect that bounds possible positions for a dockable control (EXT-1111)
void getAllowedRect(LLRect& rect);

S32 getTongueWidth() { return mDockTongue->getWidth(); }
S32 getTongueHeight() { return mDockTongue->getHeight(); }
S32 getTongueWidth() const { return mDockTongue->getWidth(); }
S32 getTongueHeight() const { return mDockTongue->getHeight(); }

private:
virtual void moveDockable();
Expand Down
2 changes: 1 addition & 1 deletion indra/llui/lldraghandle.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class LLDragHandle : public LLView
void setMaxTitleWidth(S32 max_width) {mMaxTitleWidth = llmin(max_width, mMaxTitleWidth); }
S32 getMaxTitleWidth() const { return mMaxTitleWidth; }
void setButtonsRect(const LLRect& rect){ mButtonsRect = rect; }
LLRect getButtonsRect() { return mButtonsRect; }
LLRect getButtonsRect() const { return mButtonsRect; }
void setTitleVisible(bool visible);

virtual void setTitle( const std::string& title ) = 0;
Expand Down
2 changes: 1 addition & 1 deletion indra/llui/llfiltereditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class LLFilterEditor : public LLSearchEditor
LLFilterEditor(const Params&);
friend class LLUICtrlFactory;

/*virtual*/ void handleKeystroke();
void handleKeystroke() override;
};

#endif // LL_FILTEREDITOR_H
4 changes: 2 additions & 2 deletions indra/llui/llflashtimer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ void LLFlashTimer::stopFlashing()
mCurrentTickCount = 0;
}

bool LLFlashTimer::isFlashingInProgress()
bool LLFlashTimer::isFlashingInProgress() const
{
return mIsFlashingInProgress;
}

bool LLFlashTimer::isCurrentlyHighlighted()
bool LLFlashTimer::isCurrentlyHighlighted() const
{
return mIsCurrentlyHighlighted;
}
Expand Down
4 changes: 2 additions & 2 deletions indra/llui/llflashtimer.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ class LLFlashTimer : public LLEventTimer
void startFlashing();
void stopFlashing();

bool isFlashingInProgress();
bool isCurrentlyHighlighted();
bool isFlashingInProgress() const;
bool isCurrentlyHighlighted() const;
/*
* Use this instead of deleting this object.
* The next call to tick() will return true and that will destroy this object.
Expand Down
2 changes: 1 addition & 1 deletion indra/llui/llflatlistview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1337,7 +1337,7 @@ void LLFlatListViewEx::updateNoItemsMessage(const std::string& filter_string)
}
}

bool LLFlatListViewEx::getForceShowingUnmatchedItems()
bool LLFlatListViewEx::getForceShowingUnmatchedItems() const
{
return mForceShowingUnmatchedItems;
}
Expand Down
14 changes: 7 additions & 7 deletions indra/llui/llflatlistview.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@ class LLFlatListView : public LLScrollContainer, public LLEditMenuHandler
/** Returns full rect of child panel */
const LLRect& getItemsRect() const;

LLRect getRequiredRect() { return getItemsRect(); }
LLRect getRequiredRect() const { return getItemsRect(); }

/** Returns distance between items */
const S32 getItemsPad() { return mItemPad; }
const S32 getItemsPad() const { return mItemPad; }

/**
* Adds and item and LLSD value associated with it to the list at specified position
Expand Down Expand Up @@ -264,7 +264,7 @@ class LLFlatListView : public LLScrollContainer, public LLEditMenuHandler
void setCommitOnSelectionChange(bool b) { mCommitOnSelectionChange = b; }

/** Get number of selected items in the list */
U32 numSelected() const {return static_cast<U32>(mSelectedItemPairs.size()); }
U32 numSelected() const { return static_cast<U32>(mSelectedItemPairs.size()); }

/** Get number of (visible) items in the list */
U32 size(const bool only_visible_items = true) const;
Expand Down Expand Up @@ -294,8 +294,8 @@ class LLFlatListView : public LLScrollContainer, public LLEditMenuHandler

void scrollToShowFirstSelectedItem();

void selectFirstItem ();
void selectLastItem ();
void selectFirstItem();
void selectLastItem();

virtual S32 notify(const LLSD& info) ;

Expand Down Expand Up @@ -478,15 +478,15 @@ class LLFlatListViewEx : public LLFlatListView
void setNoItemsMsg(const std::string& msg) { mNoItemsMsg = msg; }
void setNoFilteredItemsMsg(const std::string& msg) { mNoFilteredItemsMsg = msg; }

bool getForceShowingUnmatchedItems();
bool getForceShowingUnmatchedItems() const;

void setForceShowingUnmatchedItems(bool show);

/**
* Sets up new filter string and filters the list.
*/
void setFilterSubString(const std::string& filter_str, bool notify_parent);
std::string getFilterSubString() { return mFilterSubString; }
std::string getFilterSubString() const { return mFilterSubString; }

/**
* Filters the list, rearranges and notifies parent about shape changes.
Expand Down
2 changes: 1 addition & 1 deletion indra/llui/llfloater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2165,7 +2165,7 @@ void LLFloater::setCanDrag(bool can_drag)
}
}

bool LLFloater::getCanDrag()
bool LLFloater::getCanDrag() const
{
return mDragHandle->getEnabled();
}
Expand Down
39 changes: 19 additions & 20 deletions indra/llui/llfloater.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,24 +46,24 @@ class LLMultiFloater;
class LLFloater;


const bool RESIZE_YES = true;
const bool RESIZE_NO = false;
constexpr bool RESIZE_YES = true;
constexpr bool RESIZE_NO = false;

const bool DRAG_ON_TOP = false;
const bool DRAG_ON_LEFT = true;
constexpr bool DRAG_ON_TOP = false;
constexpr bool DRAG_ON_LEFT = true;

const bool MINIMIZE_YES = true;
const bool MINIMIZE_NO = false;
constexpr bool MINIMIZE_YES = true;
constexpr bool MINIMIZE_NO = false;

const bool CLOSE_YES = true;
const bool CLOSE_NO = false;
constexpr bool CLOSE_YES = true;
constexpr bool CLOSE_NO = false;

const bool ADJUST_VERTICAL_YES = true;
const bool ADJUST_VERTICAL_NO = false;
constexpr bool ADJUST_VERTICAL_YES = true;
constexpr bool ADJUST_VERTICAL_NO = false;

const F32 CONTEXT_CONE_IN_ALPHA = 0.f;
const F32 CONTEXT_CONE_OUT_ALPHA = 1.f;
const F32 CONTEXT_CONE_FADE_TIME = .08f;
constexpr F32 CONTEXT_CONE_IN_ALPHA = 0.f;
constexpr F32 CONTEXT_CONE_OUT_ALPHA = 1.f;
constexpr F32 CONTEXT_CONE_FADE_TIME = .08f;

namespace LLFloaterEnums
{
Expand Down Expand Up @@ -228,7 +228,7 @@ class LLFloater : public LLPanel, public LLInstanceTracker<LLFloater>
/*virtual*/ void setIsChrome(bool is_chrome);
/*virtual*/ void setRect(const LLRect &rect);
void setIsSingleInstance(bool is_single_instance);
bool getIsSingleInstance() { return mSingleInstance; }
bool getIsSingleInstance() const { return mSingleInstance; }

void initFloater(const Params& p);

Expand Down Expand Up @@ -274,17 +274,17 @@ class LLFloater : public LLPanel, public LLInstanceTracker<LLFloater>
static bool isShown(const LLFloater* floater);
static bool isVisible(const LLFloater* floater);
static bool isMinimized(const LLFloater* floater);
bool isFirstLook() { return mFirstLook; } // EXT-2653: This function is necessary to prevent overlapping for secondary showed toasts
bool isFirstLook() const { return mFirstLook; } // EXT-2653: This function is necessary to prevent overlapping for secondary showed toasts
virtual bool isFrontmost();
bool isDependent() { return !mDependeeHandle.isDead(); }
bool isDependent() const { return !mDependeeHandle.isDead(); }
void setCanMinimize(bool can_minimize);
void setCanClose(bool can_close);
void setCanTearOff(bool can_tear_off);
virtual void setCanResize(bool can_resize);
void setCanDrag(bool can_drag);
bool getCanDrag();
bool getCanDrag() const;
void setHost(LLMultiFloater* host);
bool isResizable() const { return mResizable; }
bool isResizable() const { return mResizable; }
void setResizeLimits( S32 min_width, S32 min_height );
void getResizeLimits( S32* min_width, S32* min_height ) { *min_width = mMinWidth; *min_height = mMinHeight; }

Expand Down Expand Up @@ -347,7 +347,7 @@ class LLFloater : public LLPanel, public LLInstanceTracker<LLFloater>
virtual void setDocked(bool docked, bool pop_on_undock = true);

virtual void setTornOff(bool torn_off) { mTornOff = torn_off; }
bool isTornOff() {return mTornOff;}
bool isTornOff() const { return mTornOff; }
void setOpenPositioning(LLFloaterEnums::EOpenPositioning pos) {mPositioning = pos;}


Expand Down Expand Up @@ -425,7 +425,6 @@ class LLFloater : public LLPanel, public LLInstanceTracker<LLFloater>
private:
void setForeground(bool b); // called only by floaterview
void cleanupHandles(); // remove handles to dead floaters
void createMinimizeButton();
void buildButtons(const Params& p);

// Images and tooltips are named in the XML, but we want to look them
Expand Down
1 change: 0 additions & 1 deletion indra/llui/llfloaterreglistener.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#define LL_LLFLOATERREGLISTENER_H

#include "lleventapi.h"
#include <string>

class LLSD;

Expand Down
2 changes: 1 addition & 1 deletion indra/llui/llflyoutbutton.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class LLFlyoutButton : public LLComboBox
LLFlyoutButton(const Params&);
friend class LLUICtrlFactory;
public:
virtual void draw();
void draw() override;

void setToggleState(bool state);

Expand Down
2 changes: 1 addition & 1 deletion indra/llui/llfocusmgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class LLFocusMgr
LLFocusableElement* getLastKeyboardFocus() const { return mLastKeyboardFocus; }
bool childHasKeyboardFocus( const LLView* parent ) const;
void removeKeyboardFocusWithoutCallback( const LLFocusableElement* focus );
bool getKeystrokesOnly() { return mKeystrokesOnly; }
bool getKeystrokesOnly() const { return mKeystrokesOnly; }
void setKeystrokesOnly(bool keystrokes_only) { mKeystrokesOnly = keystrokes_only; }

F32 getFocusFlashAmt() const;
Expand Down
Loading
Loading