UIfy ChoicePage.
This commit is contained in:
parent
e58fe43a03
commit
201cba6c77
@ -54,6 +54,7 @@ calamares_add_plugin( partition
|
|||||||
jobs/PartitionJob.cpp
|
jobs/PartitionJob.cpp
|
||||||
jobs/ResizePartitionJob.cpp
|
jobs/ResizePartitionJob.cpp
|
||||||
UI
|
UI
|
||||||
|
gui/ChoicePage.ui
|
||||||
gui/CreatePartitionDialog.ui
|
gui/CreatePartitionDialog.ui
|
||||||
gui/CreatePartitionTableDialog.ui
|
gui/CreatePartitionTableDialog.ui
|
||||||
gui/EditExistingPartitionDialog.ui
|
gui/EditExistingPartitionDialog.ui
|
||||||
|
@ -45,47 +45,32 @@ ChoicePage::ChoicePage( QWidget* parent )
|
|||||||
, m_nextEnabled( false )
|
, m_nextEnabled( false )
|
||||||
, m_core( nullptr )
|
, m_core( nullptr )
|
||||||
{
|
{
|
||||||
QBoxLayout* mainLayout = new QVBoxLayout;
|
setupUi( this );
|
||||||
setLayout( mainLayout );
|
|
||||||
|
|
||||||
m_messageLabel = new QLabel;
|
|
||||||
m_messageLabel->setWordWrap( true );
|
m_messageLabel->setWordWrap( true );
|
||||||
|
|
||||||
m_itemsLayout = new QVBoxLayout;
|
|
||||||
CalamaresUtils::unmarginLayout( m_itemsLayout );
|
CalamaresUtils::unmarginLayout( m_itemsLayout );
|
||||||
|
|
||||||
/// Drive selector + preview
|
// Drive selector + preview
|
||||||
QLabel* driveLabel = new QLabel( this );
|
CALAMARES_RETRANSLATE( m_drivesLabel->setText( tr( "Select drive:" ) ); )
|
||||||
mainLayout->addWidget( driveLabel );
|
|
||||||
CALAMARES_RETRANSLATE( driveLabel->setText( tr( "Select drive:" ) ); )
|
|
||||||
|
|
||||||
m_drivesView = new QListView;
|
m_drivesView->setViewMode( QListView::ListMode );
|
||||||
mainLayout->addWidget( m_drivesView );
|
|
||||||
m_drivesView->setViewMode( QListView::IconMode );
|
|
||||||
m_drivesView->setWrapping( false );
|
m_drivesView->setWrapping( false );
|
||||||
m_drivesView->setFlow( QListView::LeftToRight );
|
m_drivesView->setFlow( QListView::TopToBottom );
|
||||||
m_drivesView->setSelectionRectVisible( false );
|
m_drivesView->setSelectionRectVisible( false );
|
||||||
m_drivesView->setWordWrap( true );
|
m_drivesView->setWordWrap( true );
|
||||||
m_drivesView->setUniformItemSizes( true );
|
m_drivesView->setUniformItemSizes( true );
|
||||||
m_drivesView->setSelectionMode( QAbstractItemView::SingleSelection );
|
m_drivesView->setSelectionMode( QAbstractItemView::SingleSelection );
|
||||||
|
|
||||||
m_drivesView->setIconSize( CalamaresUtils::defaultIconSize() * 3 );
|
m_drivesView->setIconSize( CalamaresUtils::defaultIconSize() / 2 );
|
||||||
m_drivesView->setGridSize( QSize( CalamaresUtils::defaultFontHeight() * 8,
|
// m_drivesView->setGridSize( QSize( CalamaresUtils::defaultFontHeight() * 8,
|
||||||
m_drivesView->iconSize().height() +
|
// m_drivesView->iconSize().height() +
|
||||||
CalamaresUtils::defaultFontHeight() * 4 ) );
|
// CalamaresUtils::defaultFontHeight() * 4 ) );
|
||||||
m_drivesView->setMinimumHeight( m_drivesView->gridSize().height() +
|
// m_drivesView->setMinimumHeight( m_drivesView->gridSize().height() +
|
||||||
CalamaresUtils::defaultFontHeight() / 2 );
|
// CalamaresUtils::defaultFontHeight() / 2 );
|
||||||
m_drivesView->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred );
|
|
||||||
|
|
||||||
m_previewFrame = new QWidget;
|
|
||||||
m_previewFrame->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Expanding );
|
m_previewFrame->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Expanding );
|
||||||
mainLayout->addWidget( m_previewFrame );
|
|
||||||
// end
|
// end
|
||||||
|
|
||||||
//mainLayout->addSpacing( CalamaresUtils::defaultFontHeight() );
|
|
||||||
mainLayout->addWidget( m_messageLabel );
|
|
||||||
mainLayout->addLayout( m_itemsLayout );
|
|
||||||
mainLayout->addStretch();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -19,6 +19,8 @@
|
|||||||
#ifndef CHOICEPAGE_H
|
#ifndef CHOICEPAGE_H
|
||||||
#define CHOICEPAGE_H
|
#define CHOICEPAGE_H
|
||||||
|
|
||||||
|
#include "ui_ChoicePage.h"
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
#include "core/OsproberEntry.h"
|
#include "core/OsproberEntry.h"
|
||||||
@ -31,7 +33,7 @@ class QListView;
|
|||||||
|
|
||||||
class PartitionCoreModule;
|
class PartitionCoreModule;
|
||||||
|
|
||||||
class ChoicePage : public QWidget
|
class ChoicePage : public QWidget, private Ui::ChoicePage
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
@ -62,11 +64,7 @@ private:
|
|||||||
|
|
||||||
bool m_nextEnabled;
|
bool m_nextEnabled;
|
||||||
PartitionCoreModule* m_core;
|
PartitionCoreModule* m_core;
|
||||||
QBoxLayout* m_itemsLayout;
|
|
||||||
QLabel* m_messageLabel;
|
|
||||||
|
|
||||||
QListView* m_drivesView;
|
|
||||||
QWidget* m_previewFrame;
|
|
||||||
QMutex m_previewsMutex;
|
QMutex m_previewsMutex;
|
||||||
|
|
||||||
Choice m_choice;
|
Choice m_choice;
|
||||||
|
58
src/modules/partition/gui/ChoicePage.ui
Normal file
58
src/modules/partition/gui/ChoicePage.ui
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>ChoicePage</class>
|
||||||
|
<widget class="QWidget" name="ChoicePage">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>743</width>
|
||||||
|
<height>512</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Form</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="m_drivesLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="m_drivesLabel">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string notr="true"/>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true"><m_drivesLabel></string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QListView" name="m_drivesView"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="m_leftLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="m_messageLabel">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string notr="true"/>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true"><m_messageLabel></string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="m_itemsLayout"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QWidget" name="m_previewFrame" native="true"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
Loading…
Reference in New Issue
Block a user