Skip to content
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

Adding multiple widgets to a FlexLayout doesn't seem to work #846

Closed
JellyBrick opened this issue Jun 30, 2021 · 3 comments
Closed

Adding multiple widgets to a FlexLayout doesn't seem to work #846

JellyBrick opened this issue Jun 30, 2021 · 3 comments

Comments

@JellyBrick
Copy link

JellyBrick commented Jun 30, 2021

Describe the bug

LyricsViews (https://github.com/HelloWorld017/alspotify/blob/master/app/components/LyricsView/index.js): Working

NowPlayingView (https://github.com/HelloWorld017/alspotify/blob/master/app/components/NowPlayingView/index.js): Not Working (working without LyricsView)

When I use FlexLayout:

image

When I use QBoxLayout instead of FlexLayout:

image

To Reproduce

Steps to reproduce the behavior:

  • Add multiple widgets to FlexLayout

(https://github.com/HelloWorld017/alspotify/blob/master/app/views/MainWindow.js)

class MainWindow extends QMainWindow {
	constructor() {
		super();
		this.setWindowTitle('Alspotify');
		this.setWindowFlag(WindowType.FramelessWindowHint, true);
		this.setWindowFlag(WindowType.WindowStaysOnTopHint, true);
		this.setWindowFlag(WindowType.WindowTransparentForInput, true);
		this.setWindowFlag(WindowType.SubWindow, true);
		this.setAttribute(WidgetAttribute.WA_NoSystemBackground, true);
		this.setAttribute(WidgetAttribute.WA_TranslucentBackground, true);

		const layout = new FlexLayout();
		const widget = new QWidget();
		widget.setObjectName('Root');
		widget.setLayout(layout);

>		layout.addWidget(new LyricsView());
>		layout.addWidget(new NowPlayingView());

		this.setCentralWidget(widget);

Expected behavior

NodeGUI 0.24.0 (Windows 10)

(https://github.com/HelloWorld017/alspotify/blob/master/README.md)
image


Desktop (please complete the following information):

  • OS: Linux/KDE Plasma 5.22.1 & Windows
  • NodeGUI version: 0.32.0
  • OS Version: Gentoo Linux kernel 5.12.10 / Windows 10

Additional context

@JellyBrick JellyBrick changed the title Adding multiple widgets to the FlexLayout doesn't seem to work Adding multiple widgets to a FlexLayout doesn't seem to work Jul 7, 2021
@a7ul
Copy link
Collaborator

a7ul commented Jul 9, 2021

Not sure but I dont see a call to
this.setCentralWidget(widget);
anywhere so the widget just gets initialized and destroyed ?

@JellyBrick
Copy link
Author

Not sure but I dont see a call to
this.setCentralWidget(widget);
anywhere so the widget just gets initialized and destroyed ?

https://github.com/HelloWorld017/alspotify/blob/3ca4e4ece319e47662f572e8aeca161c6e391e49/app/views/MainWindow.js#L34

@JellyBrick
Copy link
Author

JellyBrick commented Jan 17, 2023

It caused by 3fe8f17
#814

I resolved it by using resize and setMinimumSize methods.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants