mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-27 17:35: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
|
@ -74,6 +74,7 @@ CalamaresWindow::CalamaresWindow( QWidget* parent )
|
|||
using CalamaresUtils::windowPreferredHeight;
|
||||
using CalamaresUtils::windowPreferredWidth;
|
||||
|
||||
// Needs to match what's checked in DebugWindow
|
||||
this->setObjectName("mainApp");
|
||||
|
||||
QSize availableSize = qApp->desktop()->availableGeometry( this ).size();
|
||||
|
|
|
@ -20,8 +20,10 @@
|
|||
#include "DebugWindow.h"
|
||||
#include "ui_DebugWindow.h"
|
||||
|
||||
#include "Branding.h"
|
||||
#include "utils/Retranslator.h"
|
||||
#include "utils/qjsonmodel.h"
|
||||
|
||||
#include "JobQueue.h"
|
||||
#include "Job.h"
|
||||
#include "GlobalStorage.h"
|
||||
|
@ -186,7 +188,20 @@ DebugWindow::DebugWindow()
|
|||
}
|
||||
} );
|
||||
|
||||
// Tools page
|
||||
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(
|
||||
m_ui->retranslateUi( this );
|
||||
|
|
|
@ -100,6 +100,13 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="reloadStylesheetButton">
|
||||
<property name="text">
|
||||
<string>Reload Stylesheet</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue