Mudlet / Mudlet

⚔️ A cross-platform, open source, and super fast MUD client with scripting in Lua
https://mudlet.org
GNU General Public License v2.0
738 stars 268 forks source link

Main window borders settings affect userwindows #1010

Closed vadi2 closed 7 years ago

vadi2 commented 7 years ago

Every userwindow that's created inherits the main window's border settings, which is a real problem if you're using a UI that sets them (example) - there's a lot of wasted space on the userwindow then.

vadi2 commented 7 years ago

@itsTheFae not sure if you're across this, just realised it's never been filed but it is a major issue for use of userwindows...

itsTheFae commented 7 years ago

Where do the styles get set? Some light reading shows me something about a style sheet and using either the class name or the objectName property to selectively set the styles.
When I made the TDockWidget, if there was previously styles applied to QDockWidget we should only need to copy those styles for the TDockWidget variation.

And do these things ever need to be set or configurable?

vadi2 commented 7 years ago

See

    int mBorderBottomHeight;
    int mBorderLeftWidth;
    int mBorderRightWidth;
    int mBorderTopHeight;

These settings are already configurable through the Lua API and Mudlets settings!

itsTheFae commented 7 years ago

This had me confused for a second but I think I've found the issue.

Line 968 of mudlet.cpp uses the wrong constructor for the TConsole object, the line should be changed from:
auto pC = new TConsole( pHost, false ); To:
auto pC = new TConsole( pHost, false, pD );

That should cause the TConsole to register as a sub-console and avoid it using the border settings from the main console.

SlySven commented 7 years ago

That extra argument is used to supply a QWidget * parent - it uses the same constructor but it has a default 0 {i.e. a nullptr} value used if not supplied. That being the case it does affect the execution path in the constructor so I can believe this...