Skip to content

Commit

Permalink
QskApplicationView -> QskMainView
Browse files Browse the repository at this point in the history
  • Loading branch information
uwerat committed Mar 10, 2023
1 parent b55e5ee commit 560cc60
Show file tree
Hide file tree
Showing 6 changed files with 117 additions and 111 deletions.
14 changes: 5 additions & 9 deletions examples/gallery/main.cpp
Expand Up @@ -14,7 +14,7 @@
#include <SkinnyShapeProvider.h>
#include <SkinnyNamespace.h>

#include <QskApplicationView.h>
#include <QskMainView.h>
#include <QskFocusIndicator.h>
#include <QskObjectCounter.h>
#include <QskTabView.h>
Expand Down Expand Up @@ -182,10 +182,6 @@ namespace
}
};

/*
Once QskApplicationView and friends are implemented we can replace
Header/ApplicationWindow with it. TODO ...
*/
class Header : public QskLinearBox
{
Q_OBJECT
Expand Down Expand Up @@ -219,11 +215,11 @@ namespace
void enabledToggled( bool );
};

class ApplicationView : public QskApplicationView
class MainView : public QskMainView
{
public:
ApplicationView( QQuickItem* parent = nullptr )
: QskApplicationView( parent )
MainView( QQuickItem* parent = nullptr )
: QskMainView( parent )
{
auto header = new Header( this );

Expand Down Expand Up @@ -260,7 +256,7 @@ int main( int argc, char* argv[] )

SkinnyShortcut::enable( SkinnyShortcut::AllShortcuts );

auto mainView = new ApplicationView();
auto mainView = new MainView();

QskWindow window;
window.addItem( mainView );
Expand Down
13 changes: 13 additions & 0 deletions qmlexport/QskQml.cpp
Expand Up @@ -13,6 +13,7 @@
#include <QskAspect.h>
#include <QskBoxBorderMetrics.h>
#include <QskBoxShapeMetrics.h>
#include <QskComboBox.h>
#include <QskDialog.h>
#include <QskDialogButton.h>
#include <QskDialogButtonBox.h>
Expand All @@ -22,14 +23,18 @@
#include <QskGradient.h>
#include <QskGradientDirection.h>
#include <QskGraphicLabel.h>
#include <QskIcon.h>
#include <QskIntervalF.h>
#include <QskLayoutMetrics.h>
#include <QskLabelData.h>
#include <QskMainView.h>
#include <QskMargins.h>
#include <QskMessageWindow.h>
#include <QskPlacementPolicy.h>
#include <QskPopup.h>
#include <QskProgressBar.h>
#include <QskPushButton.h>
#include <QskRadioBox.h>
#include <QskScrollArea.h>
#include <QskScrollView.h>
#include <QskSelectionWindow.h>
Expand All @@ -40,6 +45,7 @@
#include <QskSkin.h>
#include <QskSkinManager.h>
#include <QskSlider.h>
#include <QskSpinBox.h>
#include <QskStandardSymbol.h>
#include <QskStatusIndicator.h>
#include <QskSubWindow.h>
Expand Down Expand Up @@ -200,8 +206,13 @@ void QskQml::registerTypes()
registerObject< QskLinearBoxQml >( "LinearBox" );

registerObject< QskControl >();

registerObject< QskMainView >();
registerObject< QskComboBox >();
registerObject< QskGraphicLabel >();
registerObject< QskVirtualKeyboard >();
registerObject< QskRadioBox >();
registerObject< QskSpinBox >();
registerObject< QskTextLabel >();
registerObject< QskTabButton >();
registerObject< QskTabBar >();
Expand Down Expand Up @@ -242,6 +253,8 @@ void QskQml::registerTypes()
registerGadget< QskLayoutMetrics >();
registerGadget< QskMargins >();

registerGadget< QskIcon >();
registerGadget< QskLabelData >();
registerGadget< QskGradient >();
registerGadget< QskGradientStop >();
registerGadget< QskLinearDirection >();
Expand Down
95 changes: 0 additions & 95 deletions src/controls/QskApplicationView.cpp

This file was deleted.

92 changes: 92 additions & 0 deletions src/controls/QskMainView.cpp
@@ -0,0 +1,92 @@
/******************************************************************************
* QSkinny - Copyright (C) 2022 Uwe Rathmann
* This file may be used under the terms of the QSkinny License, Version 1.0
*****************************************************************************/

#include "QskMainView.h"

/*
This code is a placeholder implementation until we know
what kind of features we actually want to have
*/
class QskMainView::PrivateData
{
public:
QPointer< QskControl > header;
QPointer< QskControl > body;
QPointer< QskControl > footer;
};

QskMainView::QskMainView( QQuickItem* parent )
: Inherited( Qt::Vertical, parent )
, m_data( new PrivateData )
{
setAutoAddChildren( false );
setSpacing( 0 );
}

QskMainView::~QskMainView()
{
}

QskControl* QskMainView::header() const
{
return m_data->header;
}

void QskMainView::setHeader( QskControl* header )
{
if ( header == m_data->header )
return;

delete m_data->header;
m_data->header = header;

if( header )
{
header->setSection( QskAspect::Header );
insertItem( 0, header );
}
}

QskControl* QskMainView::body() const
{
return m_data->body;
}

void QskMainView::setBody( QskControl* body )
{
if ( body == m_data->body )
return;

delete m_data->body;
m_data->body = body;

if( body )
{
body->setSection( QskAspect::Body );
insertItem( 1, body );
}
}

QskControl* QskMainView::footer() const
{
return m_data->footer;
}

void QskMainView::setFooter( QskControl* footer )
{
if ( footer == m_data->footer )
return;

delete m_data->footer;
m_data->footer = footer;

if( footer )
{
footer->setSection( QskAspect::Footer );
insertItem( 2, footer );
}
}

#include "moc_QskMainView.cpp"
10 changes: 5 additions & 5 deletions src/controls/QskApplicationView.h → src/controls/QskMainView.h
Expand Up @@ -3,20 +3,20 @@
* This file may be used under the terms of the QSkinny License, Version 1.0
*****************************************************************************/

#ifndef QSK_APPLICATION_VIEW_H
#define QSK_APPLICATION_VIEW_H
#ifndef QSK_MAIN_VIEW_H
#define QSK_MAIN_VIEW_H

#include "QskLinearBox.h"

class QSK_EXPORT QskApplicationView : public QskLinearBox
class QSK_EXPORT QskMainView : public QskLinearBox
{
Q_OBJECT

using Inherited = QskLinearBox;

public:
QskApplicationView( QQuickItem* parent = nullptr );
~QskApplicationView() override;
QskMainView( QQuickItem* parent = nullptr );
~QskMainView() override;

QskControl* header() const;
void setHeader( QskControl* );
Expand Down
4 changes: 2 additions & 2 deletions src/src.pro
Expand Up @@ -168,7 +168,6 @@ HEADERS += \
controls/QskAbstractButton.h \
controls/QskAnimationHint.h \
controls/QskAnimator.h \
controls/QskApplicationView.h \
controls/QskBoundedControl.h \
controls/QskBoundedInput.h \
controls/QskBoundedRangeInput.h \
Expand All @@ -194,6 +193,7 @@ HEADERS += \
controls/QskInputGrabber.h \
controls/QskListView.h \
controls/QskListViewSkinlet.h \
controls/QskMainView.h \
controls/QskMenu.h \
controls/QskMenuSkinlet.h \
controls/QskObjectTree.h \
Expand Down Expand Up @@ -259,7 +259,6 @@ SOURCES += \
controls/QskAbstractButton.cpp \
controls/QskAnimator.cpp \
controls/QskAnimationHint.cpp \
controls/QskApplicationView.cpp \
controls/QskBoundedControl.cpp \
controls/QskBoundedInput.cpp \
controls/QskBoundedRangeInput.cpp \
Expand All @@ -285,6 +284,7 @@ SOURCES += \
controls/QskInputGrabber.cpp \
controls/QskListView.cpp \
controls/QskListViewSkinlet.cpp \
controls/QskMainView.cpp \
controls/QskMenuSkinlet.cpp \
controls/QskMenu.cpp \
controls/QskObjectTree.cpp \
Expand Down

0 comments on commit 560cc60

Please sign in to comment.