mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-28 09:55:37 -04:00
[libcalamares] Add a reload-stylesheet button
- This is a debugging-option to test stylesheet changes quickly. - Right now, the stylesheet is cached, so it doesn't even work.
This commit is contained in:
parent
ee3a2bcbe8
commit
b5625fc14d
3 changed files with 25 additions and 2 deletions
|
@ -59,7 +59,7 @@ CalamaresWindow::CalamaresWindow( QWidget* parent )
|
||||||
// If we can never cancel, don't show the window-close button
|
// If we can never cancel, don't show the window-close button
|
||||||
if ( Calamares::Settings::instance()->disableCancel() )
|
if ( Calamares::Settings::instance()->disableCancel() )
|
||||||
setWindowFlag( Qt::WindowCloseButtonHint, false );
|
setWindowFlag( Qt::WindowCloseButtonHint, false );
|
||||||
|
|
||||||
CALAMARES_RETRANSLATE(
|
CALAMARES_RETRANSLATE(
|
||||||
setWindowTitle( Calamares::Settings::instance()->isSetupMode()
|
setWindowTitle( Calamares::Settings::instance()->isSetupMode()
|
||||||
? tr( "%1 Setup Program" ).arg( *Calamares::Branding::ProductName )
|
? tr( "%1 Setup Program" ).arg( *Calamares::Branding::ProductName )
|
||||||
|
@ -74,6 +74,7 @@ CalamaresWindow::CalamaresWindow( QWidget* parent )
|
||||||
using CalamaresUtils::windowPreferredHeight;
|
using CalamaresUtils::windowPreferredHeight;
|
||||||
using CalamaresUtils::windowPreferredWidth;
|
using CalamaresUtils::windowPreferredWidth;
|
||||||
|
|
||||||
|
// Needs to match what's checked in DebugWindow
|
||||||
this->setObjectName("mainApp");
|
this->setObjectName("mainApp");
|
||||||
|
|
||||||
QSize availableSize = qApp->desktop()->availableGeometry( this ).size();
|
QSize availableSize = qApp->desktop()->availableGeometry( this ).size();
|
||||||
|
@ -173,7 +174,7 @@ CalamaresWindow::CalamaresWindow( QWidget* parent )
|
||||||
// and requires an extra show() (at least with KWin/X11) which
|
// and requires an extra show() (at least with KWin/X11) which
|
||||||
// is too annoying. Instead, leave it up to ignoring-the-quit-
|
// is too annoying. Instead, leave it up to ignoring-the-quit-
|
||||||
// event, which is also the ViewManager's responsibility.
|
// event, which is also the ViewManager's responsibility.
|
||||||
|
|
||||||
mainLayout->addWidget( m_viewManager->centralWidget() );
|
mainLayout->addWidget( m_viewManager->centralWidget() );
|
||||||
setStyleSheet( Calamares::Branding::instance()->stylesheet() );
|
setStyleSheet( Calamares::Branding::instance()->stylesheet() );
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,8 +20,10 @@
|
||||||
#include "DebugWindow.h"
|
#include "DebugWindow.h"
|
||||||
#include "ui_DebugWindow.h"
|
#include "ui_DebugWindow.h"
|
||||||
|
|
||||||
|
#include "Branding.h"
|
||||||
#include "utils/Retranslator.h"
|
#include "utils/Retranslator.h"
|
||||||
#include "utils/qjsonmodel.h"
|
#include "utils/qjsonmodel.h"
|
||||||
|
|
||||||
#include "JobQueue.h"
|
#include "JobQueue.h"
|
||||||
#include "Job.h"
|
#include "Job.h"
|
||||||
#include "GlobalStorage.h"
|
#include "GlobalStorage.h"
|
||||||
|
@ -186,7 +188,20 @@ DebugWindow::DebugWindow()
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
// Tools page
|
||||||
connect( m_ui->crashButton, &QPushButton::clicked, this, [] { ::crash(); } );
|
connect( m_ui->crashButton, &QPushButton::clicked, this, [] { ::crash(); } );
|
||||||
|
connect( m_ui->reloadStylesheetButton, &QPushButton::clicked,
|
||||||
|
[]()
|
||||||
|
{
|
||||||
|
for ( auto* w : qApp->topLevelWidgets() )
|
||||||
|
{
|
||||||
|
// Needs to match what's set in CalamaresWindow
|
||||||
|
if ( w->objectName() == QStringLiteral( "mainApp" ) )
|
||||||
|
{
|
||||||
|
w->setStyleSheet( Calamares::Branding::instance()->stylesheet() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
CALAMARES_RETRANSLATE(
|
CALAMARES_RETRANSLATE(
|
||||||
m_ui->retranslateUi( this );
|
m_ui->retranslateUi( this );
|
||||||
|
|
|
@ -100,6 +100,13 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="reloadStylesheetButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>Reload Stylesheet</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="verticalSpacer">
|
<spacer name="verticalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue