Browse Source

added code for using a style class for holding grid and font information

tags/1.3
Sven Oliver Moll 6 years ago
parent
commit
9467290c02

+ 7
- 0
FridgeGrid.pro View File

@@ -0,0 +1,7 @@

# only for Qt Creator

TEMPLATE = subdirs

SUBDIRS += src


+ 3
- 0
README.md View File

@@ -4,6 +4,9 @@ FridgeGrid
FridgeGrid is a tool intended to help planning cycle exact code for effects on
old school hardware.

Think of it as a combination of grid paper and fridge magnets in digital form
with save and load functions.

Originally developed for creating Atari 2600 VCS demos, it was extended be
usable for other systems as well. Templates include also the VIC-20 and the
C64.

+ 0
- 138
src/Makefile View File

@@ -1,138 +0,0 @@
#############################################################################
# Makefile for building: src
# Generated by qmake (2.01a) (Qt 4.8.1) on: Fri Apr 5 18:57:12 2013
# Project: src.pro
# Template: subdirs
# Command: /opt/mxe/usr/bin/i686-pc-mingw32-qmake CONFIG+=debug_and_release -o Makefile src.pro
#############################################################################

first: make_default
MAKEFILE = Makefile
QMAKE = /opt/mxe/usr/bin/i686-pc-mingw32-qmake
DEL_FILE = rm -f
CHK_DIR_EXISTS= test -d
MKDIR = mkdir -p
COPY = cp
COPY_FILE = $(COPY)
COPY_DIR = cp -R
INSTALL_FILE = $(COPY_FILE)
INSTALL_PROGRAM = $(COPY_FILE)
INSTALL_DIR = $(COPY_DIR)
DEL_FILE = rm -f
SYMLINK = ln -s
DEL_DIR = rmdir
MOVE = mv
CHK_DIR_EXISTS= test -d
MKDIR = mkdir -p
SUBTARGETS = \
sub-fridgegrid

fridgegrid/$(MAKEFILE):
@$(CHK_DIR_EXISTS) fridgegrid/ || $(MKDIR) fridgegrid/
cd fridgegrid/ && $(QMAKE) /home/svolli/src/fridgegrid/src/fridgegrid/fridgegrid.pro CONFIG+=debug_and_release -o $(MAKEFILE)
sub-fridgegrid-qmake_all: FORCE
@$(CHK_DIR_EXISTS) fridgegrid/ || $(MKDIR) fridgegrid/
cd fridgegrid/ && $(QMAKE) /home/svolli/src/fridgegrid/src/fridgegrid/fridgegrid.pro CONFIG+=debug_and_release -o $(MAKEFILE)
sub-fridgegrid: fridgegrid/$(MAKEFILE) FORCE
cd fridgegrid/ && $(MAKE) -f $(MAKEFILE)
sub-fridgegrid-make_default: fridgegrid/$(MAKEFILE) FORCE
cd fridgegrid/ && $(MAKE) -f $(MAKEFILE)
sub-fridgegrid-make_first: fridgegrid/$(MAKEFILE) FORCE
cd fridgegrid/ && $(MAKE) -f $(MAKEFILE) first
sub-fridgegrid-all: fridgegrid/$(MAKEFILE) FORCE
cd fridgegrid/ && $(MAKE) -f $(MAKEFILE) all
sub-fridgegrid-clean: fridgegrid/$(MAKEFILE) FORCE
cd fridgegrid/ && $(MAKE) -f $(MAKEFILE) clean
sub-fridgegrid-distclean: fridgegrid/$(MAKEFILE) FORCE
cd fridgegrid/ && $(MAKE) -f $(MAKEFILE) distclean
sub-fridgegrid-install_subtargets: fridgegrid/$(MAKEFILE) FORCE
cd fridgegrid/ && $(MAKE) -f $(MAKEFILE) install
sub-fridgegrid-uninstall_subtargets: fridgegrid/$(MAKEFILE) FORCE
cd fridgegrid/ && $(MAKE) -f $(MAKEFILE) uninstall

Makefile: src.pro /opt/mxe/usr/i686-pc-mingw32/mkspecs/unsupported/win32-g++-4.6-cross/qmake.conf /opt/mxe/usr/i686-pc-mingw32/mkspecs/qconfig.pri \
/opt/mxe/usr/i686-pc-mingw32/mkspecs/modules/qt_webkit_version.pri \
/opt/mxe/usr/i686-pc-mingw32/mkspecs/features/qt_functions.prf \
/opt/mxe/usr/i686-pc-mingw32/mkspecs/features/qt_config.prf \
/opt/mxe/usr/i686-pc-mingw32/mkspecs/unsupported/win32-g++-cross/qmake.conf \
/opt/mxe/usr/i686-pc-mingw32/mkspecs/features/exclusive_builds.prf \
/opt/mxe/usr/i686-pc-mingw32/mkspecs/features/default_pre.prf \
/opt/mxe/usr/i686-pc-mingw32/mkspecs/features/win32/default_pre.prf \
/opt/mxe/usr/i686-pc-mingw32/mkspecs/features/release.prf \
/opt/mxe/usr/i686-pc-mingw32/mkspecs/features/debug_and_release.prf \
/opt/mxe/usr/i686-pc-mingw32/mkspecs/features/default_post.prf \
/opt/mxe/usr/i686-pc-mingw32/mkspecs/features/win32/default_post.prf \
/opt/mxe/usr/i686-pc-mingw32/mkspecs/features/win32/stl.prf \
/opt/mxe/usr/i686-pc-mingw32/mkspecs/features/win32/rtti.prf \
/opt/mxe/usr/i686-pc-mingw32/mkspecs/features/win32/exceptions.prf \
/opt/mxe/usr/i686-pc-mingw32/mkspecs/features/warn_on.prf \
/opt/mxe/usr/i686-pc-mingw32/mkspecs/features/qt.prf \
/opt/mxe/usr/i686-pc-mingw32/mkspecs/features/win32/thread.prf \
/opt/mxe/usr/i686-pc-mingw32/mkspecs/features/moc.prf \
/opt/mxe/usr/i686-pc-mingw32/mkspecs/features/win32/windows.prf \
/opt/mxe/usr/i686-pc-mingw32/mkspecs/features/resources.prf \
/opt/mxe/usr/i686-pc-mingw32/mkspecs/features/uic.prf \
/opt/mxe/usr/i686-pc-mingw32/mkspecs/features/yacc.prf \
/opt/mxe/usr/i686-pc-mingw32/mkspecs/features/lex.prf \
/opt/mxe/usr/i686-pc-mingw32/mkspecs/features/include_source_dir.prf
$(QMAKE) CONFIG+=debug_and_release -o Makefile src.pro
/opt/mxe/usr/i686-pc-mingw32/mkspecs/qconfig.pri:
/opt/mxe/usr/i686-pc-mingw32/mkspecs/modules/qt_webkit_version.pri:
/opt/mxe/usr/i686-pc-mingw32/mkspecs/features/qt_functions.prf:
/opt/mxe/usr/i686-pc-mingw32/mkspecs/features/qt_config.prf:
/opt/mxe/usr/i686-pc-mingw32/mkspecs/unsupported/win32-g++-cross/qmake.conf:
/opt/mxe/usr/i686-pc-mingw32/mkspecs/features/exclusive_builds.prf:
/opt/mxe/usr/i686-pc-mingw32/mkspecs/features/default_pre.prf:
/opt/mxe/usr/i686-pc-mingw32/mkspecs/features/win32/default_pre.prf:
/opt/mxe/usr/i686-pc-mingw32/mkspecs/features/release.prf:
/opt/mxe/usr/i686-pc-mingw32/mkspecs/features/debug_and_release.prf:
/opt/mxe/usr/i686-pc-mingw32/mkspecs/features/default_post.prf:
/opt/mxe/usr/i686-pc-mingw32/mkspecs/features/win32/default_post.prf:
/opt/mxe/usr/i686-pc-mingw32/mkspecs/features/win32/stl.prf:
/opt/mxe/usr/i686-pc-mingw32/mkspecs/features/win32/rtti.prf:
/opt/mxe/usr/i686-pc-mingw32/mkspecs/features/win32/exceptions.prf:
/opt/mxe/usr/i686-pc-mingw32/mkspecs/features/warn_on.prf:
/opt/mxe/usr/i686-pc-mingw32/mkspecs/features/qt.prf:
/opt/mxe/usr/i686-pc-mingw32/mkspecs/features/win32/thread.prf:
/opt/mxe/usr/i686-pc-mingw32/mkspecs/features/moc.prf:
/opt/mxe/usr/i686-pc-mingw32/mkspecs/features/win32/windows.prf:
/opt/mxe/usr/i686-pc-mingw32/mkspecs/features/resources.prf:
/opt/mxe/usr/i686-pc-mingw32/mkspecs/features/uic.prf:
/opt/mxe/usr/i686-pc-mingw32/mkspecs/features/yacc.prf:
/opt/mxe/usr/i686-pc-mingw32/mkspecs/features/lex.prf:
/opt/mxe/usr/i686-pc-mingw32/mkspecs/features/include_source_dir.prf:
qmake: qmake_all FORCE
@$(QMAKE) CONFIG+=debug_and_release -o Makefile src.pro

qmake_all: sub-fridgegrid-qmake_all FORCE

make_default: sub-fridgegrid-make_default FORCE
make_first: sub-fridgegrid-make_first FORCE
all: sub-fridgegrid-all FORCE
clean: sub-fridgegrid-clean FORCE
distclean: sub-fridgegrid-distclean FORCE
-$(DEL_FILE) Makefile
install_subtargets: sub-fridgegrid-install_subtargets FORCE
uninstall_subtargets: sub-fridgegrid-uninstall_subtargets FORCE

sub-fridgegrid-sub_Debug: fridgegrid/$(MAKEFILE)
cd fridgegrid/ && $(MAKE) -f $(MAKEFILE) debug
debug: sub-fridgegrid-sub_Debug

sub-fridgegrid-sub_Release: fridgegrid/$(MAKEFILE)
cd fridgegrid/ && $(MAKE) -f $(MAKEFILE) release
release: sub-fridgegrid-sub_Release

sub-fridgegrid-check: fridgegrid/$(MAKEFILE)
cd fridgegrid/ && $(MAKE) -f $(MAKEFILE) check
check: sub-fridgegrid-check

mocclean: compiler_moc_header_clean compiler_moc_source_clean

mocables: compiler_moc_header_make_all compiler_moc_source_make_all
install: install_subtargets FORCE

uninstall: uninstall_subtargets FORCE

FORCE:


+ 8
- 7
src/fridgegrid/DragLabel.cpp View File

@@ -1,5 +1,5 @@
/*
* tools/src/fridgemagnets/MainWindow.cpp
* src/fridgegrid/MainWindow.cpp
* written by Sven Oliver Moll
*
* distributed under the terms of the GNU General Public License (GPL)
@@ -174,6 +174,9 @@ void DragLabel::setGridSize( const QSize &size )

void DragLabel::draw()
{
QFont font( mpParent->gridStyle().font() );
font.setStyleStrategy( QFont::ForceOutline );

if( mSize.width() <= 0 )
{
mSize.setWidth( 1 );
@@ -182,8 +185,9 @@ void DragLabel::draw()
{
mSize.setHeight( 1 );
}
QFontMetrics metric(font());
QSize size = metric.size(Qt::TextSingleLine, mText);
QFontMetrics metric( font );
QString text( mpParent->gridStyle().toUpper() ? mText.toUpper() : mText );
QSize size = metric.size( Qt::TextSingleLine, text );

int imgWidth = 0;
int imgHeight = 0;
@@ -206,9 +210,6 @@ void DragLabel::draw()
setSizeIncrement( grid );
image.fill(qRgba(0, 0, 0, 0));

QFont font;
font.setStyleStrategy( QFont::ForceOutline );

QPainter painter;
painter.begin( &image );
painter.setRenderHint( QPainter::Antialiasing );
@@ -226,7 +227,7 @@ void DragLabel::draw()
{
painter.setPen( QColor(0,0,0) );
}
painter.drawText( QRect(QPoint(2, 0), size), Qt::AlignCenter, mText );
painter.drawText( QRect(mpParent->gridStyle().topLeft(), size), Qt::AlignCenter, text );
painter.end();

if( rotate )

+ 1
- 2
src/fridgegrid/DragLabel.hpp View File

@@ -1,5 +1,5 @@
/*
* tools/src/fridgemagnets/DragLabel.hpp
* src/fridgegrid/DragLabel.hpp
* written by Sven Oliver Moll
*
* distributed under the terms of the GNU General Public License (GPL)
@@ -31,7 +31,6 @@ class QFrame;
class DragWidget;



/*!
\brief \todo


+ 1
- 1
src/fridgegrid/DragLabelPropertiesDialog.cpp View File

@@ -1,5 +1,5 @@
/*
* tools/src/fridgemagnets/MainWindow.cpp
* src/fridgegrid/MainWindow.cpp
* written by Sven Oliver Moll
*
* distributed under the terms of the GNU General Public License (GPL)

+ 1
- 1
src/fridgegrid/DragLabelPropertiesDialog.hpp View File

@@ -1,5 +1,5 @@
/*
* tools/src/fridgemagnets/MainWindow.hpp
* src/fridgegrid/MainWindow.hpp
* written by Sven Oliver Moll
*
* distributed under the terms of the GNU General Public License (GPL)

+ 37
- 29
src/fridgegrid/DragWidget.cpp View File

@@ -1,5 +1,5 @@
/*
* tools/src/fridgemagnets/MainWindow.cpp
* src/fridgegrid/MainWindow.cpp
* written by Sven Oliver Moll
*
* distributed under the terms of the GNU General Public License (GPL)
@@ -33,17 +33,14 @@
#include "DragLabel.hpp"


const int DragWidget::cGridX = 19;
const int DragWidget::cGridY = 19;


DragWidget::DragWidget( QWidget *parent )
: QWidget( parent )
, mpTextEdit( 0 )
, mGridSize( cGridX, cGridY )
, mGridStyle( "Default", QSize(15,15),
QFont("ErbosDraco Nova Open NBP", 6), QPoint( 2, 1 ), true )
{
setMinimumSize( 400, 200 );
setAcceptDrops(true);
setAcceptDrops( true );
}


@@ -54,7 +51,7 @@ DragWidget::~DragWidget()

QSize DragWidget::gridSize()
{
return mGridSize;
return mGridStyle.gridSize();
}


@@ -70,30 +67,29 @@ void DragWidget::updateLabelPos( const QSize &newSize )
QList<DragLabel*> labels( findChildren<DragLabel*>() );
foreach( DragLabel *label, labels )
{
QPoint gridPos( label->pos().x() / mGridSize.width(),
label->pos().y() / mGridSize.height() );
sizemap.insert( label, gridPos );
sizemap.insert( label, pos2grid( label->pos() ) );
}
mGridSize = newSize;
mGridStyle.setGridSize( newSize );
foreach( DragLabel *label, labels )
{
place( label, sizemap.value(label).x() * mGridSize.width(),
sizemap.value(label).y() * mGridSize.height() );
place( label, grid2pos( sizemap.value(label) ) );
label->draw();
}
update();
}


void DragWidget::setGridX( int x )
QPoint DragWidget::grid2pos( const QPoint &pos )
{
updateLabelPos( QSize( x, mGridSize.height() ) );
return QPoint( pos.x() / mGridStyle.gridSize().width(),
pos.y() / mGridStyle.gridSize().height() );
}


void DragWidget::setGridY( int y )
QPoint DragWidget::pos2grid( const QPoint &grid )
{
updateLabelPos( QSize( mGridSize.width(), y ) );
return QPoint( grid.x() * mGridStyle.gridSize().width(),
grid.y() * mGridStyle.gridSize().height() );
}


@@ -268,11 +264,11 @@ void DragWidget::paintEvent( QPaintEvent *event )
QPainter painter( this );
painter.setRenderHint( QPainter::Antialiasing );
painter.setBrush( Qt::black );
for( int i = mGridSize.width() - 1; i < size().width() ; i += mGridSize.width() )
for( int i = mGridStyle.gridSize().width() - 1; i < size().width() ; i += mGridStyle.gridSize().width() )
{
painter.drawLine( i, 0, i, size().height() - 1 );
}
for( int i = mGridSize.height() - 1; i < size().height() ; i += mGridSize.height() )
for( int i = mGridStyle.gridSize().height() - 1; i < size().height() ; i += mGridStyle.gridSize().height() )
{
painter.drawLine( 0, i, size().width() - 1, i );
}
@@ -282,21 +278,21 @@ void DragWidget::paintEvent( QPaintEvent *event )

void DragWidget::place( QWidget *w, int x, int y )
{
if( (x % mGridSize.width()) > (mGridSize.width() / 2) )
if( (x % mGridStyle.gridSize().width()) > (mGridStyle.gridSize().width() / 2) )
{
x += mGridSize.width();
x += mGridStyle.gridSize().width();
}
if( (y % mGridSize.height()) > (mGridSize.height() / 2) )
if( (y % mGridStyle.gridSize().height()) > (mGridStyle.gridSize().height() / 2) )
{
y += mGridSize.height();
y += mGridStyle.gridSize().height();
}
x -= (x % mGridSize.width());
y -= (y % mGridSize.height());
x -= (x % mGridStyle.gridSize().width());
y -= (y % mGridStyle.gridSize().height());
w->move( x + 1, y + 1 );
}


void DragWidget::place(QWidget *w, const QPoint &p)
void DragWidget::place( QWidget *w, const QPoint &p )
{
place( w, p.x(), p.y() );
}
@@ -449,7 +445,7 @@ QVariant DragWidget::getData()
foreach( DragLabel *label, labels )
{
QVariantMap map;
map.insert( "pos", label->pos() );
map.insert( "pos", pos2grid( label->pos() ) );
map.insert( "data", label->toByteArray() );
list.append( map );
}
@@ -472,7 +468,7 @@ void DragWidget::setData( const QVariant &data )
{
QVariantMap map( element.toMap() );
DragLabel *newLabel = new DragLabel( this );
QPoint pos = map.value( "pos" ).toPoint();
QPoint pos( grid2pos( map.value( "pos" ).toPoint() ) );
newLabel->setFromByteArray( map.value( "data" ).toByteArray() );
if( pos.isNull() )
{
@@ -486,3 +482,15 @@ void DragWidget::setData( const QVariant &data )
}
}
}


GridStyle DragWidget::gridStyle() const
{
return mGridStyle;
}


void DragWidget::setGridStyle(const GridStyle &gridStyle)
{
mGridStyle = gridStyle;
}

+ 14
- 11
src/fridgegrid/DragWidget.hpp View File

@@ -1,5 +1,5 @@
/*
* tools/src/fridgemagnets/DragWidget.hpp
* src/fridgegrid/DragWidget.hpp
* written by Sven Oliver Moll
*
* distributed under the terms of the GNU General Public License (GPL)
@@ -19,6 +19,7 @@
/* local library headers */

/* local headers */
#include "GridStyle.hpp"

/* forward declaration of Qt classes */
class QDomDocument;
@@ -58,32 +59,34 @@ public:
*/
QSize gridSize();

static const int cGridX; /*!< \brief \todo TODO */
static const int cGridY; /*!< \brief \todo TODO */

QVariant getData();
void setData( const QVariant &data );

GridStyle gridStyle() const;
void setGridStyle( const GridStyle &gridStyle );

/*!
\brief \todo

\param textEdit
*/
void setTextEdit(QTextEdit *textEdit);
void setTextEdit( QTextEdit *textEdit );

public slots:
/*!
\brief \todo

\param x
\param pos
\return QPoint
*/
void setGridX( int x );
QPoint grid2pos( const QPoint &pos );
/*!
\brief \todo

\param y
\param grid
\return QPoint
*/
void setGridY( int y );
QPoint pos2grid( const QPoint &grid );
public slots:
/*!
\brief \todo

@@ -164,7 +167,7 @@ private:
void updateLabelPos( const QSize &newSize );

QTextEdit *mpTextEdit; /*!< \brief \todo TODO */
QSize mGridSize; /*!< \brief \todo TODO */
GridStyle mGridStyle; /*!< \brief \todo TODO */
};

#endif

+ 116
- 0
src/fridgegrid/GridStyle.cpp View File

@@ -0,0 +1,116 @@
/*
* src/fridgegrid/MainWindow.cpp
* written by Sven Oliver Moll
*
* distributed under the terms of the GNU General Public License (GPL)
* available at http://www.gnu.org/licenses/gpl.html
*/

/* class declaration */
#include "GridStyle.hpp"

/* system headers */

/* Qt headers */
#include <QColorDialog>
#include <QGridLayout>
#include <QLineEdit>
#include <QPushButton>
#include <QSpinBox>

/* local library headers */

/* local headers */


GridStyle::GridStyle( const QString &name, const QSize &gridSize,
const QFont &font, const QPoint &topLeft,
bool toUpper )
: mName( name )
, mGridSize( gridSize )
, mFont( font )
, mTopLeft( topLeft )
, mToUpper( toUpper )
{
}


GridStyle::GridStyle( const GridStyle &that )
: mName( that.mName )
, mGridSize( that.mGridSize )
, mFont( that.mFont )
, mTopLeft( that.mTopLeft )
, mToUpper( that.mToUpper )
{
}


GridStyle &GridStyle::operator=( const GridStyle &that )
{
mName = that.mName;
mGridSize = that.mGridSize;
mFont = that.mFont;
mTopLeft = that.mTopLeft;
mToUpper = that.mToUpper;

return *this;
}


bool GridStyle::operator<( const GridStyle &that )
{
return mName < that.mName;
}


GridStyle::~GridStyle()
{
}


QFont GridStyle::font() const
{
return mFont;
}


void GridStyle::setFont( const QFont &font )
{
mFont = font;
}


QSize GridStyle::gridSize() const
{
return mGridSize;
}


void GridStyle::setGridSize( const QSize &size )
{
mGridSize = size;
}


QPoint GridStyle::topLeft() const
{
return mTopLeft;
}


void GridStyle::setTopLeft( const QPoint &topLeft )
{
mTopLeft = topLeft;
}


bool GridStyle::toUpper() const
{
return mToUpper;
}


void GridStyle::setToUpper( bool toUpper )
{
mToUpper = toUpper;
}

+ 97
- 0
src/fridgegrid/GridStyle.hpp View File

@@ -0,0 +1,97 @@
/*
* src/fridgegrid/MainWindow.hpp
* written by Sven Oliver Moll
*
* distributed under the terms of the GNU General Public License (GPL)
* available at http://www.gnu.org/licenses/gpl.html
*/

#ifndef STYLE_HPP
#define STYLE_HPP STYLE_HPP

/* base class */
#include <QDialog>

/* system headers */

/* Qt headers */
#include <QFont>
#include <QSize>
#include <QString>

/* local library headers */

/* local headers */

/* forward declaration of Qt classes */

/* forward declaration of local classes */


/*!
\brief \todo

*/
class GridStyle
{
public:
/*!
\brief constructor

\param name
\param gridSize
\param font
*/
explicit GridStyle( const QString &name, const QSize &gridSize,
const QFont &font, const QPoint &topLeft,
bool toUpper );
/*!
\brief copy constructor

\param parent
*/
GridStyle( const GridStyle &that );
/*!
\brief assignment operator

\param that
*/
GridStyle &operator=( const GridStyle &that );
bool operator<( const GridStyle &that );

/*!
\brief destructor

*/
virtual ~GridStyle();

Q_PROPERTY( QFont font
READ font
WRITE setFont )
QFont font() const;
void setFont( const QFont &font );
Q_PROPERTY( QSize gridSize
READ gridSize
WRITE setGridSize )
QSize gridSize() const;
void setGridSize( const QSize &size );
Q_PROPERTY( QPoint topLeft
READ topLeft
WRITE setTopLeft )
QPoint topLeft() const;
void setTopLeft( const QPoint &topLeft );
Q_PROPERTY( bool toUpper
READ toUpper
WRITE setToUpper )
bool toUpper() const;
void setToUpper( bool toUpper );

private:
QString mName;
QSize mGridSize;
QFont mFont;
QPoint mTopLeft;
bool mToUpper;
};

#endif

+ 1
- 16
src/fridgegrid/MainWindow.cpp View File

@@ -1,5 +1,5 @@
/*
* tools/src/fridgemagnets/MainWindow.cpp
* src/fridgegrid/MainWindow.cpp
* written by Sven Oliver Moll
*
* distributed under the terms of the GNU General Public License (GPL)
@@ -47,7 +47,6 @@ MainWindow::MainWindow( QWidget *parent, Qt::WindowFlags flags )

QToolBar *toolBar = 0;
QAction *action = 0;
QSpinBox *spinBox = 0;

toolBar = addToolBar( tr("File") );
toolBar->setObjectName( "FileToolBar" );
@@ -75,20 +74,6 @@ MainWindow::MainWindow( QWidget *parent, Qt::WindowFlags flags )
mpDragWidget, SLOT(newElement()) );
toolBar->addAction( action );

spinBox = new QSpinBox( this );
spinBox->setRange( 7, 25 );
spinBox->setValue( mpDragWidget->gridSize().width() );
connect( spinBox, SIGNAL(valueChanged(int)),
mpDragWidget, SLOT(setGridX(int)) );
toolBar->addWidget( spinBox );

spinBox = new QSpinBox( this );
spinBox->setRange( 7, 25 );
spinBox->setValue( mpDragWidget->gridSize().height() );
connect( spinBox, SIGNAL(valueChanged(int)),
mpDragWidget, SLOT(setGridY(int)) );
toolBar->addWidget( spinBox );

restoreGeometry( settings.value( "Geometry" ).toByteArray() );
restoreState( settings.value( "State" ).toByteArray() );
QList<QDockWidget*> docks( findChildren<QDockWidget*>() );

+ 1
- 1
src/fridgegrid/MainWindow.hpp View File

@@ -1,5 +1,5 @@
/*
* tools/src/fridgemagnets/MainWindow.hpp
* src/fridgegrid/MainWindow.hpp
* written by Sven Oliver Moll
*
* distributed under the terms of the GNU General Public License (GPL)

+ 4
- 1
src/fridgegrid/fridgegrid.pro View File

@@ -5,7 +5,7 @@ QT += xml

include ( ../buildconfig.pri )

#RESOURCES += Resources/Icons.qrc
RESOURCES += ../resources/FridgeGrid.qrc
#TRANSLATIONS += Translations/otts_de.ts
CODECFORTR += UTF-8

@@ -18,6 +18,9 @@ HEADERS += DragLabelPropertiesDialog.hpp
SOURCES += DragWidget.cpp
HEADERS += DragWidget.hpp

SOURCES += GridStyle.cpp
HEADERS += GridStyle.hpp

SOURCES += MainWindow.cpp
HEADERS += MainWindow.hpp


+ 15
- 3
src/fridgegrid/main.cpp View File

@@ -1,5 +1,5 @@
/*
* tools/src/fridgemagnets/MainWindow.cpp
* src/fridgegrid/MainWindow.cpp
* written by Sven Oliver Moll
*
* distributed under the terms of the GNU General Public License (GPL)
@@ -7,11 +7,15 @@
*/

#include <QApplication>
#include <QDir>
#include <QFontDatabase>
#include "MainWindow.hpp"

int main(int argc, char *argv[])
#include <QtDebug>

int main( int argc, char *argv[] )
{
//Q_INIT_RESOURCE(fridgemagnets);
Q_INIT_RESOURCE(FridgeGrid);

QApplication::setOrganizationName("SvOlli");
QApplication::setOrganizationDomain("svolli.org");
@@ -21,6 +25,14 @@ int main(int argc, char *argv[])
#ifdef QT_KEYPAD_NAVIGATION
QApplication::setNavigationMode(Qt::NavigationModeCursorAuto);
#endif
{
QDir dir( ":/fonts" );
foreach( const QFileInfo &entry, dir.entryInfoList( QStringList("*.ttf")) )
{
int id = QFontDatabase::addApplicationFont( entry.absoluteFilePath() );
qDebug() << entry.absoluteFilePath() << id << QFontDatabase::applicationFontFamilies( id );
}
}
MainWindow window;

#ifdef Q_OS_SYMBIAN

+ 6
- 0
src/resources/FridgeGrid.qrc View File

@@ -0,0 +1,6 @@
<RCC>
<qresource prefix="/">
<file>fonts/erbosdraco_nova_open_nbp.ttf</file>
<file>fonts/erbosdraco_nova_open_nbp.txt</file>
</qresource>
</RCC>

BIN
src/resources/fonts/erbosdraco_nova_open_nbp.ttf View File


+ 29
- 0
src/resources/fonts/erbosdraco_nova_open_nbp.txt View File

@@ -0,0 +1,29 @@
ERBOS DRACO NOVA NBP
made by Nate Halley
using FontStruct
Version 1.0
Date: 10 November 2012
DESCRIPTION
===========
A near-total redesign of Erbos Draco Monospaced with small caps. Still monospaced though.
CONTAINS
========
-ErbosDraco Nova
-ErbosDraco Nova Open
LICENSE
=======
ErbosDraco Nova is Creative Commons (by-sa) Attribution Share Alike. That means it's free to download and use. You can also upload it to another website but only as long as you give me credit for making it. You can even make changes to it as long as you give me credit for making the first version and license your new version as CC-BY-SA too.
For more information, go to:
http://creativecommons.org/licenses/by-sa/3.0/
A REQUEST FROM NATE547
======================
Once you install this font, find 2 ways to make the world, the country, your home state/province/county, or your hometown better than it is. Even if it's just recycling your newspaper instead of tossing it on the rubbish.
Of course, you're not obligated by law to do either of these.... it's just a request from a Sensible Human who wants our world to change.
Duty now for the future.
Nate547 (Total FontGeek)

+ 1
- 0
src/resources/templates/C64_pal_raster_paper.xml View File

@@ -1,4 +1,5 @@
<FridgeGrid>
<comment text="C64 PAL&#xa;&#xa;as taken from lft's raster paper"/>
<elements>
<element width="1" x="68" y="0" height="30" color="#c0c0ff" text=""/>
<element width="2" x="66" y="2" height="1" color="#c0c0ff" text="S2 fetch"/>

Loading…
Cancel
Save