revise CSS and allow modular icons
@@ -33,7 +33,6 @@
|
||||
#include "project/item/footage/footage.h"
|
||||
#include "task/import/import.h"
|
||||
#include "task/taskmanager.h"
|
||||
#include "ui/icons/icons.h"
|
||||
#include "ui/style/style.h"
|
||||
#include "undo/undostack.h"
|
||||
#include "widget/menu/menushared.h"
|
||||
@@ -217,9 +216,6 @@ void Core::DeclareTypesForQt()
|
||||
|
||||
void Core::StartGUI(bool full_screen)
|
||||
{
|
||||
// Load all icons
|
||||
olive::icon::LoadAll();
|
||||
|
||||
// Set UI style
|
||||
olive::style::AppSetDefault();
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ set(OLIVE_SOURCES
|
||||
|
||||
set(OLIVE_RESOURCES
|
||||
${OLIVE_RESOURCES}
|
||||
ui/icons/icons.qrc
|
||||
ui/icons/olive-dark/olive-dark.qrc
|
||||
ui/icons/olive-light/olive-light.qrc
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
|
Before Width: | Height: | Size: 217 B |
|
Before Width: | Height: | Size: 149 B |
|
Before Width: | Height: | Size: 157 B |
|
Before Width: | Height: | Size: 170 B |
@@ -29,35 +29,53 @@
|
||||
|
||||
OUTPUT_SIZES=( 16 32 64 128 )
|
||||
|
||||
if [ $# -ne 2 ]
|
||||
if [ $# -lt 1 ]
|
||||
then
|
||||
echo Usage: $0 path-to-svgs qrc-file
|
||||
echo "Usage: $0 icon-pack-name [options]"
|
||||
echo
|
||||
echo "Example: $0 olive-dark"
|
||||
echo
|
||||
echo "Options:"
|
||||
echo " -n Only generate QRC file"
|
||||
echo
|
||||
echo Example: $0 svg icons.qrc
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SVGDIR=$1
|
||||
QRCFILE=$2
|
||||
PACKNAME=$1
|
||||
SVGDIR=$1/svg
|
||||
PNGDIR=$1
|
||||
QRCFILE=$1/$1.qrc
|
||||
|
||||
ONLYQRC=0
|
||||
|
||||
if [ "$2" == "-n" ]
|
||||
then
|
||||
ONLYQRC=1
|
||||
fi
|
||||
|
||||
truncate -s 0 $QRCFILE
|
||||
|
||||
echo "<RCC>" >> $QRCFILE
|
||||
echo " <qresource prefix=\"/icons\">" >> $QRCFILE
|
||||
echo " <qresource prefix=\"/icons/$PACKNAME\">" >> $QRCFILE
|
||||
|
||||
for f in $1/*.svg
|
||||
OutputPng() {
|
||||
echo Creating $2...
|
||||
|
||||
echo " <file>$(basename $2)</file>" >> $QRCFILE
|
||||
|
||||
if [ $ONLYQRC -eq 0 ]
|
||||
then
|
||||
inkscape -z -e $(pwd)/$2 -w $s -h $s $1
|
||||
fi
|
||||
}
|
||||
|
||||
for f in $SVGDIR/*.svg
|
||||
do
|
||||
FNBASE=$(basename -s .svg $f)
|
||||
|
||||
for s in "${OUTPUT_SIZES[@]}"
|
||||
do
|
||||
OUTPUTFN=$FNBASE.$s.png
|
||||
|
||||
echo Creating $OUTPUTFN...
|
||||
|
||||
echo " <file>$OUTPUTFN</file>" >> $QRCFILE
|
||||
|
||||
inkscape -z -e $(pwd)/$OUTPUTFN -w $s -h $s $f
|
||||
OutputPng $f $PNGDIR/$FNBASE.$s.png
|
||||
done
|
||||
done
|
||||
|
||||
|
||||
@@ -66,55 +66,55 @@ QIcon olive::icon::Add;
|
||||
QIcon olive::icon::Error;
|
||||
QIcon olive::icon::DirUp;
|
||||
|
||||
void olive::icon::LoadAll()
|
||||
void olive::icon::LoadAll(const QString& theme)
|
||||
{
|
||||
GoToStart = Create("prev");
|
||||
PrevFrame = Create("rew");
|
||||
Play = Create("play");
|
||||
Pause = Create("pause");
|
||||
NextFrame = Create("ff");
|
||||
GoToEnd = Create("next");
|
||||
GoToStart = Create(theme, "prev");
|
||||
PrevFrame = Create(theme, "rew");
|
||||
Play = Create(theme, "play");
|
||||
Pause = Create(theme, "pause");
|
||||
NextFrame = Create(theme, "ff");
|
||||
GoToEnd = Create(theme, "next");
|
||||
|
||||
New = Create("new");
|
||||
Open = Create("open");
|
||||
Save = Create("save");
|
||||
Undo = Create("undo");
|
||||
Redo = Create("redo");
|
||||
TreeView = Create("treeview");
|
||||
ListView = Create("listview");
|
||||
IconView = Create("iconview");
|
||||
New = Create(theme, "new");
|
||||
Open = Create(theme, "open");
|
||||
Save = Create(theme, "save");
|
||||
Undo = Create(theme, "undo");
|
||||
Redo = Create(theme, "redo");
|
||||
TreeView = Create(theme, "treeview");
|
||||
ListView = Create(theme, "listview");
|
||||
IconView = Create(theme, "iconview");
|
||||
|
||||
ToolPointer = Create("arrow");
|
||||
ToolEdit = Create("beam");
|
||||
ToolRipple = Create("ripple");
|
||||
ToolRolling = Create("rolling");
|
||||
ToolRazor = Create("razor");
|
||||
ToolSlip = Create("slip");
|
||||
ToolSlide = Create("slide");
|
||||
ToolHand = Create("hand");
|
||||
ToolTransition = Create("transition-tool");
|
||||
ToolPointer = Create(theme, "arrow");
|
||||
ToolEdit = Create(theme, "beam");
|
||||
ToolRipple = Create(theme, "ripple");
|
||||
ToolRolling = Create(theme, "rolling");
|
||||
ToolRazor = Create(theme, "razor");
|
||||
ToolSlip = Create(theme, "slip");
|
||||
ToolSlide = Create(theme, "slide");
|
||||
ToolHand = Create(theme, "hand");
|
||||
ToolTransition = Create(theme, "transition-tool");
|
||||
|
||||
Folder = Create("folder");
|
||||
Sequence = Create("sequence");
|
||||
Video = Create("videosource");
|
||||
Audio = Create("audiosource");
|
||||
Image = Create("imagesource");
|
||||
Folder = Create(theme, "folder");
|
||||
Sequence = Create(theme, "sequence");
|
||||
Video = Create(theme, "videosource");
|
||||
Audio = Create(theme, "audiosource");
|
||||
Image = Create(theme, "imagesource");
|
||||
|
||||
Snapping = Create("magnet");
|
||||
ZoomIn = Create("zoomin");
|
||||
ZoomOut = Create("zoomout");
|
||||
Record = Create("record");
|
||||
Add = Create("add-button");
|
||||
Error = Create("error");
|
||||
DirUp = Create("dirup");
|
||||
Snapping = Create(theme, "magnet");
|
||||
ZoomIn = Create(theme, "zoomin");
|
||||
ZoomOut = Create(theme, "zoomout");
|
||||
Record = Create(theme, "record");
|
||||
Add = Create(theme, "add-button");
|
||||
Error = Create(theme, "error");
|
||||
DirUp = Create(theme, "dirup");
|
||||
}
|
||||
|
||||
QIcon olive::icon::Create(const QString &name)
|
||||
QIcon olive::icon::Create(const QString& theme, const QString &name)
|
||||
{
|
||||
QIcon icon;
|
||||
|
||||
for (int i=0;i<ICON_SIZE_COUNT;i++) {
|
||||
icon.addFile(QString(":/icons/%1.%2.png").arg(name, QString::number(ICON_SIZES[i])),
|
||||
icon.addFile(QString(":/icons/%1/%2.%3.png").arg(theme, name, QString::number(ICON_SIZES[i])),
|
||||
QSize(ICON_SIZES[i], ICON_SIZES[i]));
|
||||
}
|
||||
|
||||
|
||||
@@ -88,6 +88,10 @@ extern QIcon DirUp;
|
||||
* There is not much reason to call this outside of LoadAll() (which stores icons globally in memory so they don't
|
||||
* have to be reloaded each time a new object needs an icon).
|
||||
*
|
||||
* @param theme
|
||||
*
|
||||
* Name of the theme (used in the URL as the folder to load PNGs from)
|
||||
*
|
||||
* @param name
|
||||
*
|
||||
* Name of the icon (will correspond to the original SVG's filename with no path or extension)
|
||||
@@ -96,7 +100,7 @@ extern QIcon DirUp;
|
||||
*
|
||||
* A QIcon object containing the various icon sizes loaded from resource
|
||||
*/
|
||||
QIcon Create(const QString& name);
|
||||
QIcon Create(const QString &theme, const QString& name);
|
||||
|
||||
/**
|
||||
* @brief Methodically load all Olive icons into global variables that can be accessed throughout the application
|
||||
@@ -104,7 +108,7 @@ QIcon Create(const QString& name);
|
||||
* It's recommended to load any UI icons here so they're ready at startup and don't need to be re-loaded upon each
|
||||
* use.
|
||||
*/
|
||||
void LoadAll();
|
||||
void LoadAll(const QString &theme);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 412 B After Width: | Height: | Size: 412 B |
|
Before Width: | Height: | Size: 510 B After Width: | Height: | Size: 510 B |
|
Before Width: | Height: | Size: 806 B After Width: | Height: | Size: 806 B |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 431 B After Width: | Height: | Size: 431 B |
|
Before Width: | Height: | Size: 573 B After Width: | Height: | Size: 573 B |
|
Before Width: | Height: | Size: 1023 B After Width: | Height: | Size: 1023 B |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 465 B After Width: | Height: | Size: 465 B |
|
Before Width: | Height: | Size: 641 B After Width: | Height: | Size: 641 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 375 B After Width: | Height: | Size: 375 B |
|
Before Width: | Height: | Size: 176 B After Width: | Height: | Size: 176 B |
|
Before Width: | Height: | Size: 192 B After Width: | Height: | Size: 192 B |
|
Before Width: | Height: | Size: 256 B After Width: | Height: | Size: 256 B |
|
Before Width: | Height: | Size: 364 B After Width: | Height: | Size: 364 B |
|
Before Width: | Height: | Size: 173 B After Width: | Height: | Size: 173 B |
|
Before Width: | Height: | Size: 193 B After Width: | Height: | Size: 193 B |
|
Before Width: | Height: | Size: 252 B After Width: | Height: | Size: 252 B |
|
Before Width: | Height: | Size: 361 B After Width: | Height: | Size: 361 B |
|
Before Width: | Height: | Size: 170 B After Width: | Height: | Size: 170 B |
|
Before Width: | Height: | Size: 189 B After Width: | Height: | Size: 189 B |
|
Before Width: | Height: | Size: 248 B After Width: | Height: | Size: 248 B |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 429 B After Width: | Height: | Size: 429 B |
|
Before Width: | Height: | Size: 625 B After Width: | Height: | Size: 625 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 371 B After Width: | Height: | Size: 371 B |
|
Before Width: | Height: | Size: 506 B After Width: | Height: | Size: 506 B |
|
Before Width: | Height: | Size: 872 B After Width: | Height: | Size: 872 B |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 349 B After Width: | Height: | Size: 349 B |
|
Before Width: | Height: | Size: 422 B After Width: | Height: | Size: 422 B |
|
Before Width: | Height: | Size: 658 B After Width: | Height: | Size: 658 B |
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 584 B After Width: | Height: | Size: 584 B |
|
Before Width: | Height: | Size: 969 B After Width: | Height: | Size: 969 B |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 380 B After Width: | Height: | Size: 380 B |
|
Before Width: | Height: | Size: 498 B After Width: | Height: | Size: 498 B |
|
Before Width: | Height: | Size: 777 B After Width: | Height: | Size: 777 B |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 423 B After Width: | Height: | Size: 423 B |
|
Before Width: | Height: | Size: 530 B After Width: | Height: | Size: 530 B |
|
Before Width: | Height: | Size: 813 B After Width: | Height: | Size: 813 B |
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 614 B After Width: | Height: | Size: 614 B |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 383 B After Width: | Height: | Size: 383 B |
|
Before Width: | Height: | Size: 569 B After Width: | Height: | Size: 569 B |
|
Before Width: | Height: | Size: 820 B After Width: | Height: | Size: 820 B |
|
Before Width: | Height: | Size: 818 B After Width: | Height: | Size: 818 B |
|
Before Width: | Height: | Size: 349 B After Width: | Height: | Size: 349 B |
|
Before Width: | Height: | Size: 388 B After Width: | Height: | Size: 388 B |
|
Before Width: | Height: | Size: 525 B After Width: | Height: | Size: 525 B |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 541 B After Width: | Height: | Size: 541 B |
|
Before Width: | Height: | Size: 934 B After Width: | Height: | Size: 934 B |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 916 B After Width: | Height: | Size: 916 B |
|
Before Width: | Height: | Size: 398 B After Width: | Height: | Size: 398 B |
|
Before Width: | Height: | Size: 537 B After Width: | Height: | Size: 537 B |
|
Before Width: | Height: | Size: 534 B After Width: | Height: | Size: 534 B |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 454 B After Width: | Height: | Size: 454 B |
|
Before Width: | Height: | Size: 678 B After Width: | Height: | Size: 678 B |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 268 B After Width: | Height: | Size: 268 B |
|
Before Width: | Height: | Size: 385 B After Width: | Height: | Size: 385 B |
|
Before Width: | Height: | Size: 633 B After Width: | Height: | Size: 633 B |
|
Before Width: | Height: | Size: 364 B After Width: | Height: | Size: 364 B |
|
Before Width: | Height: | Size: 176 B After Width: | Height: | Size: 176 B |
|
Before Width: | Height: | Size: 190 B After Width: | Height: | Size: 190 B |
|
Before Width: | Height: | Size: 247 B After Width: | Height: | Size: 247 B |
|
Before Width: | Height: | Size: 831 B After Width: | Height: | Size: 831 B |
|
Before Width: | Height: | Size: 333 B After Width: | Height: | Size: 333 B |
|
Before Width: | Height: | Size: 422 B After Width: | Height: | Size: 422 B |
|
Before Width: | Height: | Size: 516 B After Width: | Height: | Size: 516 B |
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 521 B After Width: | Height: | Size: 521 B |
|
Before Width: | Height: | Size: 739 B After Width: | Height: | Size: 739 B |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 419 B After Width: | Height: | Size: 419 B |
|
Before Width: | Height: | Size: 504 B After Width: | Height: | Size: 504 B |