Redesign. The Label editor should be in separate dialog window.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2017-08-09 17:33:20 +03:00
parent 56bb45aee7
commit 80f6a5a7d1
5 changed files with 509 additions and 335 deletions

View File

@ -14,18 +14,18 @@
<string>Pattern properties</string> <string>Pattern properties</string>
</property> </property>
<property name="windowIcon"> <property name="windowIcon">
<iconset resource="../../../libs/vmisc/share/resources/icon.qrc"> <iconset>
<normaloff>:/icon/64x64/icon64x64.png</normaloff>:/icon/64x64/icon64x64.png</iconset> <normaloff>:/icon/64x64/icon64x64.png</normaloff>:/icon/64x64/icon64x64.png</iconset>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_4"> <layout class="QVBoxLayout" name="verticalLayout_4">
<item> <item>
<widget class="QTabWidget" name="tabWidget"> <widget class="QTabWidget" name="tabWidget">
<property name="currentIndex"> <property name="currentIndex">
<number>4</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="tab"> <widget class="QWidget" name="tab">
<attribute name="title"> <attribute name="title">
<string>Description</string> <string>Pattern</string>
</attribute> </attribute>
<layout class="QVBoxLayout" name="verticalLayout_3"> <layout class="QVBoxLayout" name="verticalLayout_3">
<item> <item>
@ -85,7 +85,7 @@
<item> <item>
<widget class="QLabel" name="label"> <widget class="QLabel" name="label">
<property name="text"> <property name="text">
<string>Author name</string> <string>Author:</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -183,7 +183,7 @@
<item> <item>
<widget class="QLabel" name="label_3"> <widget class="QLabel" name="label_3">
<property name="text"> <property name="text">
<string>For technical notes.</string> <string>For technical notes</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -1205,83 +1205,131 @@
</widget> </widget>
<widget class="QWidget" name="tab_4"> <widget class="QWidget" name="tab_4">
<attribute name="title"> <attribute name="title">
<string>General info</string> <string>Label data</string>
</attribute> </attribute>
<layout class="QVBoxLayout" name="verticalLayout_12"> <layout class="QVBoxLayout" name="verticalLayout_32">
<item> <item>
<layout class="QFormLayout" name="formLayout_2"> <layout class="QHBoxLayout" name="horizontalLayout_19">
<item row="0" column="0"> <item>
<widget class="QLabel" name="label_6"> <widget class="QLabel" name="label_13">
<property name="text"> <property name="text">
<string>Pattern name:</string> <string>Label:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item>
<widget class="QLineEdit" name="lineEditPatternName"> <widget class="QPushButton" name="pushButtonEditPatternLabel">
<property name="maxLength"> <property name="toolTip">
<number>30</number> <string>Edit pattern label</string>
</property> </property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_7">
<property name="text"> <property name="text">
<string>Pattern number:</string> <string>Edit label</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item>
<widget class="QLineEdit" name="lineEditPatternNumber"> <spacer name="horizontalSpacer">
<property name="maxLength"> <property name="orientation">
<number>30</number> <enum>Qt::Horizontal</enum>
</property> </property>
</widget> <property name="sizeHint" stdset="0">
</item> <size>
<item row="2" column="0"> <width>40</width>
<widget class="QLabel" name="label_8"> <height>20</height>
<property name="text"> </size>
<string>Company/Designer name:</string>
</property> </property>
</widget> </spacer>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="lineEditCompanyName">
<property name="maxLength">
<number>30</number>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_10">
<property name="text">
<string>Customer name:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="lineEditCustomerName">
<property name="maxLength">
<number>30</number>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_12">
<property name="text">
<string>Pattern size:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLineEdit" name="lineEditSize">
<property name="maxLength">
<number>40</number>
</property>
</widget>
</item> </item>
</layout> </layout>
</item> </item>
<item>
<widget class="QGroupBox" name="groupBox_4">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>1</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Label data</string>
</property>
<layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Pattern name:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEditPatternName">
<property name="maxLength">
<number>30</number>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Pattern number:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="lineEditPatternNumber">
<property name="maxLength">
<number>30</number>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Company/Designer name:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="lineEditCompanyName">
<property name="maxLength">
<number>30</number>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_10">
<property name="text">
<string>Customer name:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="lineEditCustomerName">
<property name="maxLength">
<number>30</number>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_12">
<property name="text">
<string>Pattern size:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLineEdit" name="lineEditSize">
<property name="maxLength">
<number>40</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item> <item>
<widget class="QCheckBox" name="checkBoxShowDate"> <widget class="QCheckBox" name="checkBoxShowDate">
<property name="text"> <property name="text">
@ -1298,269 +1346,6 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="tab_5">
<attribute name="title">
<string>Pattern label data</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_13">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_9">
<item>
<widget class="QToolButton" name="toolButtonNewLabel">
<property name="toolTip">
<string>Clear current and begin new label</string>
</property>
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset theme="document-new"/>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="toolButtonImportLabel">
<property name="toolTip">
<string>Import from label template</string>
</property>
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset theme="document-open"/>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButtonExportLabel">
<property name="toolTip">
<string>Export label as template</string>
</property>
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset theme="document-save-as"/>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QListWidget" name="listWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>1</verstretch>
</sizepolicy>
</property>
<property name="dragDropMode">
<enum>QAbstractItemView::InternalMove</enum>
</property>
</widget>
</item>
<item>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_11">
<property name="spacing">
<number>6</number>
</property>
<item>
<widget class="QToolButton" name="toolButtonBold">
<property name="toolTip">
<string comment="Font formating">Bold</string>
</property>
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset theme="format-text-bold"/>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButtonItalic">
<property name="toolTip">
<string comment="Font formating">Italic</string>
</property>
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset theme="format-text-italic"/>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButtonTextLeft">
<property name="toolTip">
<string>Aligns with the left edge</string>
</property>
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset theme="format-justify-left"/>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButtonTextCenter">
<property name="toolTip">
<string>Centers horizontally in the available space</string>
</property>
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset theme="format-justify-center"/>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButtonTextRight">
<property name="toolTip">
<string>Aligns with the right edge</string>
</property>
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset theme="format-justify-right"/>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item alignment="Qt::AlignRight">
<widget class="QToolButton" name="toolButtonAdd_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset theme="list-add">
<normaloff>.</normaloff>.</iconset>
</property>
</widget>
</item>
<item alignment="Qt::AlignLeft">
<widget class="QToolButton" name="toolButtonRemove_2">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset theme="list-remove">
<normaloff>.</normaloff>.</iconset>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_11">
<property name="text">
<string>Text:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QLineEdit" name="lineEditText">
<property name="enabled">
<bool>true</bool>
</property>
<property name="placeholderText">
<string>Line of text</string>
</property>
<property name="clearButtonEnabled">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonInsert">
<property name="toolTip">
<string>Insert placeholders</string>
</property>
<property name="text">
<string>Insert...</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
</widget> </widget>
</item> </item>
<item> <item>
@ -1575,9 +1360,7 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<resources> <resources/>
<include location="../../../libs/vmisc/share/resources/icon.qrc"/>
</resources>
<connections> <connections>
<connection> <connection>
<sender>buttonBox</sender> <sender>buttonBox</sender>

View File

@ -45,7 +45,8 @@ HEADERS += \
$$PWD/tools/piece/dialogseamallowance.h \ $$PWD/tools/piece/dialogseamallowance.h \
$$PWD/tools/piece/dialogpiecepath.h \ $$PWD/tools/piece/dialogpiecepath.h \
$$PWD/tools/dialogpin.h \ $$PWD/tools/dialogpin.h \
$$PWD/tools/dialoginsertnode.h $$PWD/tools/dialoginsertnode.h \
$$PWD/support/dialogeditlabel.h
SOURCES += \ SOURCES += \
$$PWD/tools/dialogalongline.cpp \ $$PWD/tools/dialogalongline.cpp \
@ -90,7 +91,8 @@ SOURCES += \
$$PWD/tools/piece/dialogseamallowance.cpp \ $$PWD/tools/piece/dialogseamallowance.cpp \
$$PWD/tools/piece/dialogpiecepath.cpp \ $$PWD/tools/piece/dialogpiecepath.cpp \
$$PWD/tools/dialogpin.cpp \ $$PWD/tools/dialogpin.cpp \
$$PWD/tools/dialoginsertnode.cpp $$PWD/tools/dialoginsertnode.cpp \
$$PWD/support/dialogeditlabel.cpp
FORMS += \ FORMS += \
$$PWD/tools/dialogalongline.ui \ $$PWD/tools/dialogalongline.ui \
@ -139,4 +141,5 @@ FORMS += \
$$PWD/tools/piece/tabs/tabgrainline.ui \ $$PWD/tools/piece/tabs/tabgrainline.ui \
$$PWD/tools/piece/tabs/tabpins.ui \ $$PWD/tools/piece/tabs/tabpins.ui \
$$PWD/tools/dialoginsertnode.ui \ $$PWD/tools/dialoginsertnode.ui \
$$PWD/tools/piece/tabs/tabpassmarks.ui $$PWD/tools/piece/tabs/tabpassmarks.ui \
$$PWD/support/dialogeditlabel.ui

View File

@ -0,0 +1,14 @@
#include "dialogeditlabel.h"
#include "ui_dialogeditlabel.h"
DialogEditLabel::DialogEditLabel(QWidget *parent) :
QDialog(parent),
ui(new Ui::DialogEditLabel)
{
ui->setupUi(this);
}
DialogEditLabel::~DialogEditLabel()
{
delete ui;
}

View File

@ -0,0 +1,22 @@
#ifndef DIALOGEDITLABEL_H
#define DIALOGEDITLABEL_H
#include <QDialog>
namespace Ui {
class DialogEditLabel;
}
class DialogEditLabel : public QDialog
{
Q_OBJECT
public:
explicit DialogEditLabel(QWidget *parent = 0);
~DialogEditLabel();
private:
Ui::DialogEditLabel *ui;
};
#endif // DIALOGEDITLABEL_H

View File

@ -0,0 +1,352 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DialogEditLabel</class>
<widget class="QDialog" name="DialogEditLabel">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>494</width>
<height>384</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_9">
<item>
<widget class="QToolButton" name="toolButtonNewLabel">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Clear current and begin new label</string>
</property>
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset theme="document-new">
<normaloff>.</normaloff>.</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="toolButtonImportLabel">
<property name="toolTip">
<string>Import from label template</string>
</property>
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset theme="document-open">
<normaloff>.</normaloff>.</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButtonExportLabel">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Export label as template</string>
</property>
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset theme="document-save-as">
<normaloff>.</normaloff>.</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QListWidget" name="listWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>1</verstretch>
</sizepolicy>
</property>
<property name="dragDropMode">
<enum>QAbstractItemView::InternalMove</enum>
</property>
</widget>
</item>
<item>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_11">
<property name="spacing">
<number>6</number>
</property>
<item>
<widget class="QToolButton" name="toolButtonBold">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string comment="Font formating">Bold</string>
</property>
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset theme="format-text-bold">
<normaloff>.</normaloff>.</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButtonItalic">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string comment="Font formating">Italic</string>
</property>
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset theme="format-text-italic">
<normaloff>.</normaloff>.</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButtonTextLeft">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Aligns with the left edge</string>
</property>
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset theme="format-justify-left">
<normaloff>.</normaloff>.</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButtonTextCenter">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Centers horizontally in the available space</string>
</property>
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset theme="format-justify-center">
<normaloff>.</normaloff>.</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButtonTextRight">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Aligns with the right edge</string>
</property>
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset theme="format-justify-right">
<normaloff>.</normaloff>.</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item alignment="Qt::AlignRight">
<widget class="QToolButton" name="toolButtonAdd_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset theme="list-add">
<normaloff>../../../../app/valentina/dialogs</normaloff>../../../../app/valentina/dialogs</iconset>
</property>
</widget>
</item>
<item alignment="Qt::AlignLeft">
<widget class="QToolButton" name="toolButtonRemove_2">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string notr="true">...</string>
</property>
<property name="icon">
<iconset theme="list-remove">
<normaloff>../../../../app/valentina/dialogs</normaloff>../../../../app/valentina/dialogs</iconset>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_11">
<property name="text">
<string>Text:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QLineEdit" name="lineEditText">
<property name="enabled">
<bool>false</bool>
</property>
<property name="placeholderText">
<string>Line of text</string>
</property>
<property name="clearButtonEnabled">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonInsert">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Insert placeholders</string>
</property>
<property name="text">
<string>Insert...</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>DialogEditLabel</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>DialogEditLabel</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>