mirror of
https://github.com/parchlinux/calamares.git
synced 2025-02-24 19:05:46 -05:00
UIfy ChoicePage.
This commit is contained in:
parent
e58fe43a03
commit
201cba6c77
4 changed files with 73 additions and 31 deletions
|
@ -54,6 +54,7 @@ calamares_add_plugin( partition
|
|||
jobs/PartitionJob.cpp
|
||||
jobs/ResizePartitionJob.cpp
|
||||
UI
|
||||
gui/ChoicePage.ui
|
||||
gui/CreatePartitionDialog.ui
|
||||
gui/CreatePartitionTableDialog.ui
|
||||
gui/EditExistingPartitionDialog.ui
|
||||
|
|
|
@ -45,47 +45,32 @@ ChoicePage::ChoicePage( QWidget* parent )
|
|||
, m_nextEnabled( false )
|
||||
, m_core( nullptr )
|
||||
{
|
||||
QBoxLayout* mainLayout = new QVBoxLayout;
|
||||
setLayout( mainLayout );
|
||||
setupUi( this );
|
||||
|
||||
m_messageLabel = new QLabel;
|
||||
m_messageLabel->setWordWrap( true );
|
||||
|
||||
m_itemsLayout = new QVBoxLayout;
|
||||
CalamaresUtils::unmarginLayout( m_itemsLayout );
|
||||
|
||||
/// Drive selector + preview
|
||||
QLabel* driveLabel = new QLabel( this );
|
||||
mainLayout->addWidget( driveLabel );
|
||||
CALAMARES_RETRANSLATE( driveLabel->setText( tr( "Select drive:" ) ); )
|
||||
// Drive selector + preview
|
||||
CALAMARES_RETRANSLATE( m_drivesLabel->setText( tr( "Select drive:" ) ); )
|
||||
|
||||
m_drivesView = new QListView;
|
||||
mainLayout->addWidget( m_drivesView );
|
||||
m_drivesView->setViewMode( QListView::IconMode );
|
||||
m_drivesView->setViewMode( QListView::ListMode );
|
||||
m_drivesView->setWrapping( false );
|
||||
m_drivesView->setFlow( QListView::LeftToRight );
|
||||
m_drivesView->setFlow( QListView::TopToBottom );
|
||||
m_drivesView->setSelectionRectVisible( false );
|
||||
m_drivesView->setWordWrap( true );
|
||||
m_drivesView->setUniformItemSizes( true );
|
||||
m_drivesView->setSelectionMode( QAbstractItemView::SingleSelection );
|
||||
|
||||
m_drivesView->setIconSize( CalamaresUtils::defaultIconSize() * 3 );
|
||||
m_drivesView->setGridSize( QSize( CalamaresUtils::defaultFontHeight() * 8,
|
||||
m_drivesView->iconSize().height() +
|
||||
CalamaresUtils::defaultFontHeight() * 4 ) );
|
||||
m_drivesView->setMinimumHeight( m_drivesView->gridSize().height() +
|
||||
CalamaresUtils::defaultFontHeight() / 2 );
|
||||
m_drivesView->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred );
|
||||
m_drivesView->setIconSize( CalamaresUtils::defaultIconSize() / 2 );
|
||||
// m_drivesView->setGridSize( QSize( CalamaresUtils::defaultFontHeight() * 8,
|
||||
// m_drivesView->iconSize().height() +
|
||||
// CalamaresUtils::defaultFontHeight() * 4 ) );
|
||||
// m_drivesView->setMinimumHeight( m_drivesView->gridSize().height() +
|
||||
// CalamaresUtils::defaultFontHeight() / 2 );
|
||||
|
||||
m_previewFrame = new QWidget;
|
||||
m_previewFrame->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Expanding );
|
||||
mainLayout->addWidget( m_previewFrame );
|
||||
// end
|
||||
|
||||
//mainLayout->addSpacing( CalamaresUtils::defaultFontHeight() );
|
||||
mainLayout->addWidget( m_messageLabel );
|
||||
mainLayout->addLayout( m_itemsLayout );
|
||||
mainLayout->addStretch();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
#ifndef CHOICEPAGE_H
|
||||
#define CHOICEPAGE_H
|
||||
|
||||
#include "ui_ChoicePage.h"
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
#include "core/OsproberEntry.h"
|
||||
|
@ -31,7 +33,7 @@ class QListView;
|
|||
|
||||
class PartitionCoreModule;
|
||||
|
||||
class ChoicePage : public QWidget
|
||||
class ChoicePage : public QWidget, private Ui::ChoicePage
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
@ -62,11 +64,7 @@ private:
|
|||
|
||||
bool m_nextEnabled;
|
||||
PartitionCoreModule* m_core;
|
||||
QBoxLayout* m_itemsLayout;
|
||||
QLabel* m_messageLabel;
|
||||
|
||||
QListView* m_drivesView;
|
||||
QWidget* m_previewFrame;
|
||||
QMutex m_previewsMutex;
|
||||
|
||||
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…
Add table
Reference in a new issue