From e78c7f41a053c8cc7f7cdc6b17662805d539c70b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20K=C3=B6gl?= Date: Wed, 16 Apr 2014 02:23:36 +0200 Subject: [PATCH] up and down feature, editor and text selection popup will not disturb the live text anymore, better layout --- TODO | 6 +- config_files/ffserver.conf | 10 +- texter/texter/main.py | 203 +++++++++++++++++-------- texter/texter/text_model.py | 5 +- texter/texter/text_sorter_ui.py | 77 +++++++--- texter/texter/texter3.ui | 252 +++++++++++++++++++++----------- texter/texter/texter4.ui | 212 ++++++++++++++++++++------- texter/texter/texter_ui.py | 57 +++++--- 8 files changed, 580 insertions(+), 242 deletions(-) diff --git a/TODO b/TODO index 24b8aa5..5c87bb6 100644 --- a/TODO +++ b/TODO @@ -3,4 +3,8 @@ * install netplug on all servers * verkabelungsanleitung für die sensoren schreiben * server restartsicher machen - \ No newline at end of file + * anne texter erklären und installieren + * + + +11:30 Termin diff --git a/config_files/ffserver.conf b/config_files/ffserver.conf index 5cc3c48..84410fb 100644 --- a/config_files/ffserver.conf +++ b/config_files/ffserver.conf @@ -2,16 +2,16 @@ Port 8090 BindAddress 0.0.0.0 MaxClients 10 MaxBandwidth 1000000 -CustomLog - +CustomLog /tmp/ffserver.log - -file /tmp/webcam.ffm + +file /tmp/textcast.ffm FileMaxSize 10M ACL allow 127.0.0.1 - -Feed webcam.ffm + +Feed textcast.ffm Format mjpeg VideoFrameRate 25 VideoSize 768x576 diff --git a/texter/texter/main.py b/texter/texter/main.py index c24ed78..4b9411f 100644 --- a/texter/texter/main.py +++ b/texter/texter/main.py @@ -6,6 +6,7 @@ import os.path import re import subprocess import sys +from math import pow from operator import itemgetter @@ -41,41 +42,68 @@ class TextSorterDialog(QtGui.QWidget, Ui_TextSorterDialog): def __init__(self, parent = None): super(TextSorterDialog, self).__init__(parent) - ## setup the ui self.setupUi(self) - #self.setModal(False) self.fill_list() self.text_list.clicked.connect(self.slot_show_text) - #self.accepted.connect(self.slot_saveToDb) self.remove_button.clicked.connect(self.slot_removeItem) + self.move_up_button.clicked.connect(self.slot_text_up) + self.move_down_button.clicked.connect(self.slot_text_down) + self.text_list.clicked.connect(self.slot_toggle_buttons) + self.move_up_button.setEnabled(False) + self.move_down_button.setEnabled(False) + + + def slot_toggle_buttons(self, index): + row = index.row() + if row <= 0: + self.move_up_button.setEnabled(False) + else: + self.move_up_button.setEnabled(True) + + if row >= len(self.model.text_db) - 1: + self.move_down_button.setEnabled(False) + else: + self.move_down_button.setEnabled(True) def fill_list(self): self.model = self.parent().parent().model self.text_list.setModel(self.model) - #for preview, text in self.parent().text_db: - #self.text_list.insertItem(preview) def slot_text_up(self): - pass + row = self.text_list.currentIndex().row() + if row <= 0: + return False + + text_db = self.model.text_db + text_db[row-1], text_db[row] = text_db[row], text_db[row-1] + self.text_list.setCurrentIndex(self.model.index(row - 1, 0)) + self.text_list.clicked.emit(self.model.index(row - 1, 0)) + return True def slot_text_down(self): - pass + text_db = self.model.text_db + row = self.text_list.currentIndex().row() + if row >= len(text_db) - 1: + return False + + text_db[row], text_db[row+1] = text_db[row+1], text_db[row] + index = self.model.index(row + 1, 0) + self.text_list.setCurrentIndex(index) + self.text_list.clicked.emit(index) + return True def slot_show_text(self, model_index): self.text_preview.setTextOrHtml(self.parent().parent().model.text_db[model_index.row()][1]) - def slot_saveToDb(self): - data = list() - pass - def slot_removeItem(self): index = self.text_list.currentIndex().row() print "remote index", index self.model.removeRows(index, 1) - - + index = self.model.index(0, 0) + self.text_list.setCurrentIndex(index) + self.text_list.clicked.emit(index) class MainWindow(KMainWindow, Ui_MainWindow): @@ -109,13 +137,13 @@ class MainWindow(KMainWindow, Ui_MainWindow): self.toolbar.setAllowedAreas(QtCore.Qt.BottomToolBarArea) self.toolbar.setMovable(False) self.toolbar.setFloatable(False) + self.toolbar.setToolButtonStyle(QtCore.Qt.ToolButtonTextUnderIcon) self.addToolBar(QtCore.Qt.BottomToolBarArea, self.toolbar) self.createLiveActions() self.createPreviewActions() self.slot_load() - self.preview_text.document().setDefaultFont(self.font) self.preview_text.setFont(self.font) self.preview_text.setRichTextSupport(KRichTextWidget.RichTextSupport(0xffffffff)) @@ -133,9 +161,8 @@ class MainWindow(KMainWindow, Ui_MainWindow): self.show() - self.save_action.triggered.connect(self.slot_save) - self.valign_action.triggered.connect(self.slot_valign) + #self.valign_action.triggered.connect(self.slot_valign) self.publish_action.triggered.connect(self.slot_publish) self.clear_live_action.triggered.connect(self.slot_clear_live) self.clear_preview_action.triggered.connect(self.slot_clear_preview) @@ -148,13 +175,15 @@ class MainWindow(KMainWindow, Ui_MainWindow): self.save_preview_action.triggered.connect(self.slot_save_preview_text) self.streaming_action.triggered.connect(self.slot_toggle_streaming) self.auto_publish_action.toggled.connect(self.slot_auto_publish) - + self.preview_size_action.triggered[QtGui.QAction].connect(self.slot_preview_font_size) + self.live_size_action.triggered[QtGui.QAction].connect(self.slot_live_font_size) self.next_action.triggered.connect(self.slot_next_item) self.previous_action.triggered.connect(self.slot_previous_item) app.aboutToQuit.connect(self.kill_streaming) self.getLiveCoords() + print "desktop", app.desktop().availableGeometry() def getLiveCoords(self): @@ -164,6 +193,11 @@ class MainWindow(KMainWindow, Ui_MainWindow): y = global_rect.y() self.statusBar().showMessage("live text editor dimensions: x=%r, y=%r, width=%r, height=%r" % (x, y, global_rect.width(), global_rect.height())) + def getPreviewCoords(self): + public_rect = self.preview_text.geometry() + global_rect = QtCore.QRect(self.mapToGlobal(public_rect.topLeft()), self.mapToGlobal(public_rect.bottomRight())) + return global_rect.x(), global_rect.y() + def filter_editor_actions(self): @@ -173,7 +207,7 @@ class MainWindow(KMainWindow, Ui_MainWindow): "direction_ltr", "direction_rtl", "format_font_family", - "format_font_size", + #"format_font_size", "format_text_background_color", "format_list_indent_more", "format_list_indent_less", @@ -213,7 +247,6 @@ class MainWindow(KMainWindow, Ui_MainWindow): elif text == "format_font_family": self.preview_font_action = action - self.slot_set_preview_defaults() self.slot_set_live_defaults() @@ -236,8 +269,6 @@ class MainWindow(KMainWindow, Ui_MainWindow): self.save_live_action.setIconText("save live") self.save_live_action.setShortcut(KShortcut(QtGui.QKeySequence(QtCore.Qt.ALT + QtCore.Qt.Key_W)), KAction.ShortcutTypes(KAction.ActiveShortcut | KAction.DefaultShortcut)) - - def createPreviewActions(self): self.toolbar.show() self.preview_text_collection = KActionCollection(self) @@ -272,15 +303,6 @@ class MainWindow(KMainWindow, Ui_MainWindow): self.previous_action.setIconText("previous") self.previous_action.setShortcut(KShortcut(QtGui.QKeySequence(QtCore.Qt.ALT + QtCore.Qt.Key_Left)), KAction.ShortcutTypes(KAction.ActiveShortcut | KAction.DefaultShortcut)) - self.text_combo = KSelectAction(self.preview_text_collection) - self.text_combo.setEditable(False) - self.text_combo.setComboWidth(100) - icon = QtGui.QIcon.fromTheme(_fromUtf8("document-open-recent")) - self.text_combo.setIcon(icon) - self.text_combo.setIconText("saved texts") - self.text_combo.setObjectName("text_combo") - self.preview_text_collection.addAction("saved texts", self.text_combo) - self.next_action = self.preview_text_collection.addAction("next_action") icon = QtGui.QIcon.fromTheme(_fromUtf8("media-skip-forward")) self.next_action.setIcon(icon) @@ -308,21 +330,30 @@ class MainWindow(KMainWindow, Ui_MainWindow): self.save_action.setIconText("save") self.save_action.setShortcut(KShortcut(QtGui.QKeySequence(QtCore.Qt.CTRL + QtCore.Qt.Key_S)), KAction.ShortcutTypes(KAction.ActiveShortcut | KAction.DefaultShortcut)) - self.streaming_action = KToggleAction(self.live_text_collection) + self.streaming_action = KToggleAction(self.preview_text_collection) icon = QtGui.QIcon.fromTheme(_fromUtf8("media-record")) self.streaming_action.setIcon(icon) self.streaming_action.setIconText("stream") self.streaming_action.setObjectName("stream") self.streaming_action.setShortcut(KShortcut(QtGui.QKeySequence(QtCore.Qt.CTRL + QtCore.Qt.Key_1)), KAction.ShortcutTypes(KAction.ActiveShortcut | KAction.DefaultShortcut)) - self.live_text_collection.addAction("stream", self.streaming_action) + self.preview_text_collection.addAction("stream", self.streaming_action) - self.valign_action = self.preview_text_collection.addAction("valign_action") - icon = QtGui.QIcon.fromTheme(_fromUtf8("media-stop")) - self.valign_action.setIcon(icon) - self.valign_action.setIconText("valign") - self.valign_action.setShortcut(KShortcut(QtGui.QKeySequence(QtCore.Qt.CTRL + QtCore.Qt.Key_Plus)), KAction.ShortcutTypes(KAction.ActiveShortcut | KAction.DefaultShortcut)) + #self.valign_action = self.preview_text_collection.addAction("valign_action") + #icon = QtGui.QIcon.fromTheme(_fromUtf8("media-stop")) + #self.valign_action.setIcon(icon) + #self.valign_action.setIconText("valign") + #self.valign_action.setShortcut(KShortcut(QtGui.QKeySequence(QtCore.Qt.CTRL + QtCore.Qt.Key_Plus)), KAction.ShortcutTypes(KAction.ActiveShortcut | KAction.DefaultShortcut)) + self.spacer = KToolBarSpacerAction(self.preview_text_collection) + self.preview_text_collection.addAction("spacer", self.spacer) + self.text_combo = KSelectAction(self.preview_text_collection) + self.text_combo.setEditable(False) + icon = QtGui.QIcon.fromTheme(_fromUtf8("document-open-recent")) + self.text_combo.setIcon(icon) + self.text_combo.setIconText("saved texts") + self.text_combo.setObjectName("text_combo") + self.preview_text_collection.addAction("saved texts", self.text_combo) def slot_auto_publish(self, state): self.is_auto_publish = bool(state) @@ -400,6 +431,19 @@ class MainWindow(KMainWindow, Ui_MainWindow): def slot_publish(self): self.live_text.setTextOrHtml(self.preview_text.textOrHtml()) + def slot_live_font_size(self, action): + print "font_size" + self.default_size = self.live_size_action.fontSize() + self.slot_set_preview_defaults() + self.slot_set_live_defaults() + + + def slot_preview_font_size(self, action): + print "font_size" + self.default_size = self.preview_size_action.fontSize() + self.slot_set_live_defaults() + self.slot_set_preview_defaults() + def slot_toggle_publish(self, state=None): @@ -413,8 +457,8 @@ class MainWindow(KMainWindow, Ui_MainWindow): self.preview_center_action.setChecked(True) self.preview_text.alignCenter() self.font.setPointSize(self.default_size) - self.preview_text.setFont(self.font) self.preview_text.setFontSize(self.default_size) + self.preview_text.setFont(self.font) self.preview_size_action.setFontSize(self.default_size) self.preview_text.document().setDefaultFont(self.font) @@ -423,25 +467,18 @@ class MainWindow(KMainWindow, Ui_MainWindow): self.live_center_action.setChecked(True) self.live_text.alignCenter() self.font.setPointSize(self.default_size) - self.live_text.setFont(self.font) self.live_text.setFontSize(self.default_size) + self.live_text.setFont(self.font) self.live_size_action.setFontSize(self.default_size) self.live_text.document().setDefaultFont(self.font) def slot_clear_live(self): - #self.default_size = self.live_size_action.fontSize() - #cursor = self.live_text.textCursor() - #self.custom_clear(cursor) self.live_text.clear() self.slot_set_live_defaults() def slot_clear_preview(self): - #self.preview_text.document().clear() - #self.default_size = self.preview_size_action.fontSize() - #cursor = self.preview_text.textCursor() - #self.custom_clear(cursor) self.preview_text.clear() self.slot_set_preview_defaults() @@ -512,7 +549,7 @@ class MainWindow(KMainWindow, Ui_MainWindow): suffix = 1 while 1: tmp_preview = "%s_%d" % (preview, suffix) - tmp = self.text_by_preview(tmp_preview) + tmp = self.model.text_by_preview(tmp_preview) if tmp is None: preview = tmp_preview break @@ -521,8 +558,8 @@ class MainWindow(KMainWindow, Ui_MainWindow): self.model.text_db.append([preview, text]) self.model.modelReset.emit() - #action = self.text_combo.addAction(preview) - #self.text_combo.setCurrentAction(action) + action = self.text_combo.addAction(preview) + self.text_combo.setCurrentAction(action) def slot_save(self): path = os.path.expanduser("~/.texter") @@ -535,21 +572,69 @@ class MainWindow(KMainWindow, Ui_MainWindow): else: cPickle.dump(self.model.text_db, f, cPickle.HIGHEST_PROTOCOL) - def slot_valign(self): - fn = QtGui.QFontMetrics(self.font) - h = fn.height() - max_lines = 576 / h - text = unicode(self.preview_text.toPlainText()) - text = text.strip().strip("\n") - lines = text.count("\n") + 1 - self.preview_text.setTextOrHtml("\n" * ((max_lines - lines) / 2) + text) - self.statusBar().showMessage("text lines = %d, line height = %d, max lines = %d" % (lines, h, max_lines)) + #def slot_valign(self): + #fm = QtGui.QFontMetrics(self.font) + ##h = fn.height() + ##max_lines = 576 / h + ##text = unicode(self.preview_text.toPlainText()) + ##text = text.strip().strip("\n") + ##lines = text.count("\n") + 1 + ##self.preview_text.setTextOrHtml("\n" * ((max_lines - lines) / 2) + text) + ##self.statusBar().showMessage("text lines = %d, line height = %d, max lines = %d" % (lines, h, max_lines)) + #text_layout = QtGui.QTextLayout(self.preview_text.textOrHtml(), self.font, self.preview_text) + + ##self.text_combo.setCurrentAction(action) + + #margin = 10. + #radius = min(self.preview_text.width()/2.0, self.preview_text.height()/2.0) - margin + #print "radius", type(radius), radius + + #lineHeight = float(fm.height()) + #print "lineHeight", type(lineHeight), lineHeight + #y = 0. + + #text_layout.beginLayout() + + #while 1: + #line = text_layout.createLine() + #if not line.isValid(): + #break + + #x1 = max(0.0, pow(pow(radius,2)-pow(radius-y,2), 0.5)) + #x2 = max(0.0, pow(pow(radius,2)-pow(radius-(y+lineHeight),2), 0.5)) + #x = max(x1, x2) + margin + #lineWidth = (self.preview_text.width() - margin) - x + + #line.setLineWidth(lineWidth) + #line.setPosition(QtCore.QPointF(x, margin+y)) + #y += line.height() + + #text_layout.endLayout() + + #painter = QtGui.QPainter() + #painter.begin(self.preview_text) + #painter.setRenderHint(QtGui.QPainter.Antialiasing) + #painter.fillRect(self.rect(), QtCore.Qt.black) + #painter.setBrush(QtGui.QBrush(QtCore.Qt.white)) + #painter.setPen(QtGui.QPen(QtCore.Qt.white)) + #text_layout.draw(painter, QtCore.QPoint(0,0)) + + #painter.setBrush(QtGui.QBrush(QtGui.QColor("#a6ce39"))) + #painter.setPen(QtGui.QPen(QtCore.Qt.black)) + #painter.drawEllipse(QtCore.QRectF(-radius, margin, 2*radius, 2*radius)) + #painter.end() def slot_open_dialog(self): self.dialog = KDialog(self) self.dialog_widget = TextSorterDialog(self.dialog) self.dialog.setMainWidget(self.dialog_widget) - self.dialog.move(800, 0) + pos_x, pos_y = self.getPreviewCoords() + self.dialog.move(pos_x, 0) + rect = app.desktop().availableGeometry() + global_width = rect.width() + global_height = rect.height() + x = global_width - pos_x - 10 + self.dialog.setFixedSize(x, global_height-40); self.dialog.exec_() self.fill_combo_box() diff --git a/texter/texter/text_model.py b/texter/texter/text_model.py index c58c3ed..9a77880 100644 --- a/texter/texter/text_model.py +++ b/texter/texter/text_model.py @@ -48,7 +48,10 @@ class TextModel(QtCore.QAbstractTableModel): return True def flags(self, index): - return QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEditable | QtCore.Qt.ItemIsEnabled + return QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEditable | QtCore.Qt.ItemIsEnabled | QtCore.Qt.ItemIsDragEnabled | QtCore.Qt.ItemIsDropEnabled + + def supportedDropActions(self): + return QtCore.Qt.MoveAction def insertRows(self, row, count, parent=QtCore.QModelIndex()): self.beginInsertRows(parent, row, row+count+1) diff --git a/texter/texter/text_sorter_ui.py b/texter/texter/text_sorter_ui.py index 3e67e8e..5e34386 100644 --- a/texter/texter/text_sorter_ui.py +++ b/texter/texter/text_sorter_ui.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # coding=UTF-8 # -# Generated by pykdeuic4 from texter4.ui on Tue Apr 15 17:09:47 2014 +# Generated by pykdeuic4 from texter4.ui on Wed Apr 16 00:27:54 2014 # # WARNING! All changes to this file will be lost. from PyKDE4 import kdecore @@ -25,38 +25,73 @@ except AttributeError: class Ui_TextSorterDialog(object): def setupUi(self, TextSorterDialog): TextSorterDialog.setObjectName(_fromUtf8("TextSorterDialog")) - TextSorterDialog.resize(588, 584) - self.horizontalLayout = QtGui.QHBoxLayout(TextSorterDialog) - self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) + TextSorterDialog.resize(662, 716) + self.verticalLayout = QtGui.QVBoxLayout(TextSorterDialog) + self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) + self.horizontalLayout_2 = QtGui.QHBoxLayout() + self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2")) self.text_list = QtGui.QListView(TextSorterDialog) self.text_list.setMinimumSize(QtCore.QSize(0, 576)) self.text_list.setMaximumSize(QtCore.QSize(16777215, 576)) + palette = QtGui.QPalette() + brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) + brush = QtGui.QBrush(QtGui.QColor(128, 125, 123)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) + self.text_list.setPalette(palette) self.text_list.setObjectName(_fromUtf8("text_list")) - self.horizontalLayout.addWidget(self.text_list) + self.horizontalLayout_2.addWidget(self.text_list) + self.text_preview = KRichTextWidget(TextSorterDialog) + self.text_preview.setMinimumSize(QtCore.QSize(0, 576)) + self.text_preview.setMaximumSize(QtCore.QSize(16777215, 576)) + palette = QtGui.QPalette() + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) + self.text_preview.setPalette(palette) + self.text_preview.setReadOnly(True) + self.text_preview.setObjectName(_fromUtf8("text_preview")) + self.horizontalLayout_2.addWidget(self.text_preview) + self.verticalLayout.addLayout(self.horizontalLayout_2) self.kbuttongroup = KButtonGroup(TextSorterDialog) self.kbuttongroup.setObjectName(_fromUtf8("kbuttongroup")) - self.verticalLayout = QtGui.QVBoxLayout(self.kbuttongroup) - self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) + self.horizontalLayout = QtGui.QHBoxLayout(self.kbuttongroup) + self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) + self.move_down_button = KArrowButton(self.kbuttongroup) + self.move_down_button.setProperty("arrowType", 2) + self.move_down_button.setObjectName(_fromUtf8("move_down_button")) + self.horizontalLayout.addWidget(self.move_down_button) + self.move_up_button = KArrowButton(self.kbuttongroup) + self.move_up_button.setObjectName(_fromUtf8("move_up_button")) + self.horizontalLayout.addWidget(self.move_up_button) self.remove_button = KPushButton(self.kbuttongroup) icon = QtGui.QIcon.fromTheme(_fromUtf8("edit-delete")) self.remove_button.setIcon(icon) self.remove_button.setObjectName(_fromUtf8("remove_button")) - self.verticalLayout.addWidget(self.remove_button) - self.move_up_button = KArrowButton(self.kbuttongroup) - self.move_up_button.setObjectName(_fromUtf8("move_up_button")) - self.verticalLayout.addWidget(self.move_up_button) - self.move_down_button = KArrowButton(self.kbuttongroup) - self.move_down_button.setProperty("arrowType", 2) - self.move_down_button.setObjectName(_fromUtf8("move_down_button")) - self.verticalLayout.addWidget(self.move_down_button) + self.horizontalLayout.addWidget(self.remove_button) + self.verticalLayout.addWidget(self.kbuttongroup) spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.verticalLayout.addItem(spacerItem) - self.horizontalLayout.addWidget(self.kbuttongroup) - self.text_preview = KRichTextWidget(TextSorterDialog) - self.text_preview.setMinimumSize(QtCore.QSize(0, 576)) - self.text_preview.setMaximumSize(QtCore.QSize(16777215, 576)) - self.text_preview.setObjectName(_fromUtf8("text_preview")) - self.horizontalLayout.addWidget(self.text_preview) self.retranslateUi(TextSorterDialog) QtCore.QMetaObject.connectSlotsByName(TextSorterDialog) diff --git a/texter/texter/texter3.ui b/texter/texter/texter3.ui index a85a248..5318dac 100644 --- a/texter/texter/texter3.ui +++ b/texter/texter/texter3.ui @@ -6,8 +6,8 @@ 0 0 - 1554 - 584 + 1475 + 651 @@ -82,95 +82,177 @@ :/texter/icon.png:/texter/icon.png - + - - - - 768 - 576 - - - - - 768 - 576 - - - - - Monospace - 22 - - - - BlankCursor - - - - - - - - - - - - false - - - true - - - Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextEditable|Qt::TextEditorInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - KRichTextWidget::SupportAlignment|KRichTextWidget::SupportChangeListStyle|KRichTextWidget::SupportFontFamily|KRichTextWidget::SupportFontSize|KRichTextWidget::SupportIndentLists|KRichTextWidget::SupportTextForegroundColor - - + + + + + + 769 + 577 + + + + + 769 + 577 + + + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + + BlankCursor + + + false + + + true + + + Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextEditable|Qt::TextEditorInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + KRichTextWidget::SupportAlignment|KRichTextWidget::SupportChangeListStyle|KRichTextWidget::SupportFontFamily|KRichTextWidget::SupportFontSize|KRichTextWidget::SupportIndentLists|KRichTextWidget::SupportTextForegroundColor + + + + + + + + 10 + 0 + + + + + 300 + 577 + + + + + 769 + 577 + + + + Qt::ActionsContextMenu + + + preview text + + + false + + + QFrame::StyledPanel + + + true + + + Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextEditable|Qt::TextEditorInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + KRichTextWidget::SupportAlignment|KRichTextWidget::SupportChangeListStyle|KRichTextWidget::SupportFontFamily|KRichTextWidget::SupportFontSize|KRichTextWidget::SupportTextForegroundColor + + + + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 40 + 20 + + + + + - - + + + Qt::Vertical + + - 400 - 576 + 20 + 40 - - - 768 - 576 - - - - - Monospace - 22 - - - - Qt::ActionsContextMenu - - - preview text - - - false - - - QFrame::StyledPanel - - - true - - - Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextEditable|Qt::TextEditorInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - KRichTextWidget::SupportAlignment|KRichTextWidget::SupportChangeListStyle|KRichTextWidget::SupportFontFamily|KRichTextWidget::SupportFontSize|KRichTextWidget::SupportTextForegroundColor - - + diff --git a/texter/texter/texter4.ui b/texter/texter/texter4.ui index a2b8a82..bf97ac0 100644 --- a/texter/texter/texter4.ui +++ b/texter/texter/texter4.ui @@ -6,33 +6,167 @@ 0 0 - 588 - 584 + 662 + 716 Form - + - - - - 0 - 576 - - - - - 16777215 - 576 - - - + + + + + + 0 + 576 + + + + + 16777215 + 576 + + + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + + + 128 + 125 + 123 + + + + + + + 255 + 255 + 255 + + + + + + + + + + + + + 0 + 576 + + + + + 16777215 + 576 + + + + + + + + + 0 + 0 + 0 + + + + + + + + + 0 + 0 + 0 + + + + + + + + + 255 + 255 + 255 + + + + + + + + true + + + + - + + + + + 2 + + + + + + @@ -44,47 +178,21 @@ - - - - - - - 2 - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - + + + Qt::Vertical + + - 0 - 576 + 20 + 40 - - - 16777215 - 576 - - - + diff --git a/texter/texter/texter_ui.py b/texter/texter/texter_ui.py index b60c6a7..c6c0bac 100644 --- a/texter/texter/texter_ui.py +++ b/texter/texter/texter_ui.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # coding=UTF-8 # -# Generated by pykdeuic4 from texter3.ui on Tue Apr 15 16:21:39 2014 +# Generated by pykdeuic4 from texter3.ui on Wed Apr 16 00:07:33 2014 # # WARNING! All changes to this file will be lost. from PyKDE4 import kdecore @@ -25,7 +25,7 @@ except AttributeError: class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow.setObjectName(_fromUtf8("MainWindow")) - MainWindow.resize(1554, 584) + MainWindow.resize(1475, 651) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) @@ -51,19 +51,34 @@ class Ui_MainWindow(object): MainWindow.setWindowIcon(icon) self.centralwidget = QtGui.QWidget(MainWindow) self.centralwidget.setObjectName(_fromUtf8("centralwidget")) - self.horizontalLayout = QtGui.QHBoxLayout(self.centralwidget) + self.verticalLayout = QtGui.QVBoxLayout(self.centralwidget) + self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) + self.horizontalLayout = QtGui.QHBoxLayout() self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) self.live_text = KRichTextWidget(self.centralwidget) - self.live_text.setMinimumSize(QtCore.QSize(768, 576)) - self.live_text.setMaximumSize(QtCore.QSize(768, 576)) - font = QtGui.QFont() - font.setFamily(_fromUtf8("Monospace")) - font.setPointSize(22) - self.live_text.setFont(font) + self.live_text.setMinimumSize(QtCore.QSize(769, 577)) + self.live_text.setMaximumSize(QtCore.QSize(769, 577)) + palette = QtGui.QPalette() + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Highlight, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Link, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Highlight, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Link, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Highlight, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Link, brush) + self.live_text.setPalette(palette) self.live_text.viewport().setProperty("cursor", QtGui.QCursor(QtCore.Qt.BlankCursor)) - self.live_text.setToolTip(_fromUtf8("")) - self.live_text.setStatusTip(_fromUtf8("")) - self.live_text.setWhatsThis(_fromUtf8("")) self.live_text.setAutoFillBackground(False) self.live_text.setAcceptRichText(True) self.live_text.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByKeyboard|QtCore.Qt.LinksAccessibleByMouse|QtCore.Qt.TextBrowserInteraction|QtCore.Qt.TextEditable|QtCore.Qt.TextEditorInteraction|QtCore.Qt.TextSelectableByKeyboard|QtCore.Qt.TextSelectableByMouse) @@ -71,12 +86,13 @@ class Ui_MainWindow(object): self.live_text.setObjectName(_fromUtf8("live_text")) self.horizontalLayout.addWidget(self.live_text) self.preview_text = KRichTextWidget(self.centralwidget) - self.preview_text.setMinimumSize(QtCore.QSize(400, 576)) - self.preview_text.setMaximumSize(QtCore.QSize(768, 576)) - font = QtGui.QFont() - font.setFamily(_fromUtf8("Monospace")) - font.setPointSize(22) - self.preview_text.setFont(font) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) + sizePolicy.setHorizontalStretch(10) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.preview_text.sizePolicy().hasHeightForWidth()) + self.preview_text.setSizePolicy(sizePolicy) + self.preview_text.setMinimumSize(QtCore.QSize(300, 577)) + self.preview_text.setMaximumSize(QtCore.QSize(769, 577)) self.preview_text.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu) self.preview_text.setAutoFillBackground(False) self.preview_text.setFrameShape(QtGui.QFrame.StyledPanel) @@ -85,6 +101,11 @@ class Ui_MainWindow(object): self.preview_text.setRichTextSupport(KRichTextWidget.RichTextSupportValues(KRichTextWidget.SupportAlignment|KRichTextWidget.SupportChangeListStyle|KRichTextWidget.SupportFontFamily|KRichTextWidget.SupportFontSize|KRichTextWidget.SupportTextForegroundColor)) self.preview_text.setObjectName(_fromUtf8("preview_text")) self.horizontalLayout.addWidget(self.preview_text) + spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Minimum) + self.horizontalLayout.addItem(spacerItem) + self.verticalLayout.addLayout(self.horizontalLayout) + spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + self.verticalLayout.addItem(spacerItem1) MainWindow.setCentralWidget(self.centralwidget) self.retranslateUi(MainWindow)