Skip to content

Commit

Permalink
add three demo
Browse files Browse the repository at this point in the history
  • Loading branch information
litz-a committed Oct 18, 2017
1 parent 6f551ee commit 74d9c2b
Show file tree
Hide file tree
Showing 531 changed files with 34,004 additions and 0 deletions.
60 changes: 60 additions & 0 deletions MacNavBar/MacNavBar.pro
Original file line number Diff line number Diff line change
@@ -0,0 1,60 @@
# ====================================================================
# Quartica Framework - Mac NavBar
# ====================================================================

QT = core gui

greaterThan(QT_MAJOR_VERSION, 4): QT = widgets


TEMPLATE = lib
TARGET = navbar

DESTDIR = bin
UI_DIR = tmp-ui
MOC_DIR = tmp
OBJECTS_DIR = tmp

CONFIG = qt

DEPENDPATH = . include src
INCLUDEPATH = . include

# Input
QFMACNAVBAR.CLASSES = include/QfClickableLabel \
include/QfNavBarGroup \
include/QfNavBarItem \
include/QfSelectableWidget \
include/QfUiExport

QFMACNAVBAR.HEADERS = include/qf_clickablelabel.h \
include/qf_navbar.h \
include/qf_navbargroup.h \
include/qf_navbaritem.h \
include/qf_selectablewidget.h \
include/qf_uiexport.h \

QFMACNAVBAR.SOURCES = src/clickablelabel.cpp \
src/navbar.cpp \
src/navbargroup.cpp \
src/navbaritem.cpp \
src/selectablewidget.cpp

HEADERS = $$QFMACNAVBAR.HEADERS $$QFMACNAVBAR.CLASSES
SOURCES = $$QFMACNAVBAR.SOURCES

macx {
CONFIG = lib_bundle

FRAMEWORK_HEADERS.version = Versions
FRAMEWORK_HEADERS.files = $$QFMACNAVBAR.HEADERS $$QFMACNAVBAR.CLASSES
FRAMEWORK_HEADERS.path = Headers

QMAKE_BUNDLE_DATA = FRAMEWORK_HEADERS
}

win32 {
CONFIG = shared dll release
DEFINES = QFUI_MAKEDLL
}

28 changes: 28 additions & 0 deletions MacNavBar/example/example.pro
Original file line number Diff line number Diff line change
@@ -0,0 1,28 @@
######################################################################
# Automatically generated by qmake (2.01a) Sat Apr 12 08:48:14 2008
######################################################################

TEMPLATE = app
TARGET = example

QT = core gui widgets

UI_DIR = tmp-ui
MOC_DIR = tmp
OBJECTS_DIR = tmp

CONFIG = qt

DEPENDPATH = . ../include/
INCLUDEPATH = . ../include/

# Input
SOURCES = main.cpp



win32:CONFIG(release, debug|release): LIBS = -L$$PWD/../bin/ -lnavbar
else:win32:CONFIG(debug, debug|release): LIBS = -L$$PWD/../bin/ -lnavbar

INCLUDEPATH = $$PWD/../bin
DEPENDPATH = $$PWD/../bin
Binary file added MacNavBar/example/icons/z_allApps.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MacNavBar/example/icons/z_apple.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MacNavBar/example/icons/z_apps.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MacNavBar/example/icons/z_plugins.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MacNavBar/example/icons/z_prefApp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MacNavBar/example/icons/z_systemUpdates.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MacNavBar/example/icons/z_unknown.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MacNavBar/example/icons/z_upToDate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MacNavBar/example/icons/z_updates.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MacNavBar/example/icons/z_widgets.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 52 additions & 0 deletions MacNavBar/example/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 1,52 @@
/*
* This file is part of Quartica.
*
* Copyright (c) 2008 Matteo Bertozzi <[email protected]>
*
* Quartica is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Quartica is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Quartica. If not, see <http://www.gnu.org/licenses/>.
*/

// Qt4 Headers
#include <QApplication>

// Quartica Headers
#include <QfNavBar>

int main (int argc, char **argv)
{
QApplication app(argc, argv);

QfNavBar *navbar = new QfNavBar;

QfNavBarGroup *group = navbar->addGroup("APPLICATIONS");
navbar->addItem(group, QPixmap("icons/z_allApps.png"), "All Applications");
navbar->addItem(group, QPixmap("icons/z_updates.png"), "Updates");
navbar->addItem(group, QPixmap("icons/z_upToDate.png"), "Up To Date");
navbar->addItem(group, QPixmap("icons/z_unknown.png"), "Unknown");

group = navbar->addGroup("BY KIND");
navbar->addItem(group, QPixmap("icons/z_apps.png"), "Applications");
navbar->addItem(group, QPixmap("icons/z_plugins.png"), "Plugins");
navbar->addItem(group, QPixmap("icons/z_widgets.png"), "Widgets");
navbar->addItem(group, QPixmap("icons/z_prefApp.png"), "Preference Panes");
navbar->addItem(group, QPixmap("icons/z_systemUpdates.png"), "System Updates");

group = navbar->addGroup("VENDORS");
navbar->addItem(group, QPixmap("icons/z_apple.png"), "Apple");

navbar->show();

return(app.exec());
}

1 change: 1 addition & 0 deletions MacNavBar/include/QfClickableLabel
Original file line number Diff line number Diff line change
@@ -0,0 1 @@
#include "qf_clickablelabel.h"
1 change: 1 addition & 0 deletions MacNavBar/include/QfNavBar
Original file line number Diff line number Diff line change
@@ -0,0 1 @@
#include "qf_navbar.h"
1 change: 1 addition & 0 deletions MacNavBar/include/QfNavBarGroup
Original file line number Diff line number Diff line change
@@ -0,0 1 @@
#include "qf_navbargroup.h"
1 change: 1 addition & 0 deletions MacNavBar/include/QfNavBarItem
Original file line number Diff line number Diff line change
@@ -0,0 1 @@
#include "qf_navbaritem.h"
1 change: 1 addition & 0 deletions MacNavBar/include/QfSelectableWidget
Original file line number Diff line number Diff line change
@@ -0,0 1 @@
#include "qf_selectablewidget.h"
1 change: 1 addition & 0 deletions MacNavBar/include/QfUiExport
Original file line number Diff line number Diff line change
@@ -0,0 1 @@
#include "qf_uiexport.h"
47 changes: 47 additions & 0 deletions MacNavBar/include/qf_clickablelabel.h
Original file line number Diff line number Diff line change
@@ -0,0 1,47 @@
/*
* This file is part of Quartica.
*
* Copyright (c) 2008 Matteo Bertozzi <[email protected]>
*
* Quartica is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Quartica is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Quartica. If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef _QF_CLICKABLELABEL_H_
#define _QF_CLICKABLELABEL_H_

// Qt4 Headers
#include <QLabel>

// Quartica Headers
#include <QfUiExport>

class QFUI_EXPORT QfClickableLabel : public QLabel
{
Q_OBJECT

public:
QfClickableLabel (QWidget *parent = 0, Qt::WindowFlags f = 0);
QfClickableLabel (const QString& text, QWidget *parent = 0, Qt::WindowFlags f = 0);
~QfClickableLabel();

signals:
void clicked (void);
void clicked (QfClickableLabel *label);

protected:
void mouseReleaseEvent (QMouseEvent *event);
};

#endif // !_QF_CLICKABLELABEL_H_

73 changes: 73 additions & 0 deletions MacNavBar/include/qf_navbar.h
Original file line number Diff line number Diff line change
@@ -0,0 1,73 @@
/*
* This file is part of Quartica.
*
* Copyright (c) 2008 Matteo Bertozzi <[email protected]>
*
* Quartica is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Quartica is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Quartica. If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef _QF_NAVBAR_H_
#define _QF_NAVBAR_H_

// Qt4 Headers
#include <QWidget>

// Quartica Headers
#include <QfNavBarGroup>
#include <QfUiExport>

class QFUI_EXPORT QfNavBar : public QWidget
{
Q_OBJECT

Q_PROPERTY(QColor selectionColor READ selectionColor WRITE setSelectionColor)
Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor)

public:
QfNavBar (QWidget *parent = 0);
~QfNavBar();

// Methods - Groups Related
void addGroup (QfNavBarGroup *group);
QfNavBarGroup *addGroup (const QString& title);

bool containsGroup (QfNavBarGroup *group);

// Methods - Items Related
void addItem (QfNavBarGroup *group, QfNavBarItem *item);
QfNavBarItem *addItem (QfNavBarGroup *group, const QString& text);
QfNavBarItem *addItem (QfNavBarGroup *group, const QPixmap& icon, const QString& text);

// GET Properties
QColor selectionColor (void) const;
QColor backgroundColor (void) const;

// SET Properties
void setBackgroundColor (const QColor& bgColor);
void setSelectionColor (const QColor& selectionColor);

protected:
void paintEvent (QPaintEvent *event);

private slots:
void onGroupExpanded (QfNavBarGroup *group);
void onItemSelected (QfNavBarGroup *group, QfNavBarItem *item);

private:
class Private;
Private *d;
};

#endif // !_QF_NAVBAR_H_

79 changes: 79 additions & 0 deletions MacNavBar/include/qf_navbargroup.h
Original file line number Diff line number Diff line change
@@ -0,0 1,79 @@
/*
* This file is part of Quartica.
*
* Copyright (c) 2008 Matteo Bertozzi <[email protected]>
*
* Quartica is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Quartica is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Quartica. If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef _QF_NAVBARGROUP_H_
#define _QF_NAVBARGROUP_H_

// Qt4 Headers
#include <QWidget>

// Quartica Headers
#include <QfNavBarItem>
#include <QfUiExport>

class QFUI_EXPORT QfNavBarGroup : public QWidget
{
Q_OBJECT

Q_PROPERTY(QString title READ title WRITE setTitle)
Q_PROPERTY(bool isExpanded READ isExpanded WRITE expand)

public:
QfNavBarGroup (QWidget *parent = 0);
QfNavBarGroup (const QString& title, QWidget *parent = 0);
~QfNavBarGroup();

// Methods - Add Item
void addItem (QfNavBarItem *item);
void addItem (QfNavBarItem *item, int index);

// Methods - Create and Add Item
QfNavBarItem *addItem (const QString& text);
QfNavBarItem *addItem (const QPixmap& icon, const QString& text);
QfNavBarItem *addItem (const QPixmap& icon, const QString& text, int index);

// Methods
bool containsItem (QfNavBarItem *item);

// GET Properties
QString title (void) const;
bool isExpanded (void) const;

// SET Properties
void setTitle (const QString& title);
void setTitleColor (const QColor& color);

signals:
void selected (QfNavBarGroup *group, QfNavBarItem *item);
void expanded (QfNavBarGroup *group);

public slots:
void expand (bool expand);

private slots:
void onItemSelected (QfSelectableWidget *item);
void onTitleClicked (void);

private:
class Private;
Private *d;
};

#endif // !_QF_NAVBARGROUP_H_

Loading

0 comments on commit 74d9c2b

Please sign in to comment.