Skip to content

Commit

Permalink
Editor bug fixes
Browse files Browse the repository at this point in the history
Fixed note font color bug (was always default color (black))
Auto-remove empty notes
Added textEdit.setFocus to fix invisible cursor bug (also diacritics)
Removed references to Qt3 and KDE3 support
  • Loading branch information
Gleb Baryshev committed Aug 24, 2013
1 parent ed2a349 commit 647b736
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
qtcreator-build
build/*
*.user
*~
2 changes: 1 addition & 1 deletion basketp.pro
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
#-------------------------------------------------

QT += gui xml network qt3support dbus
QT += gui xml network dbus

TARGET = basket
TEMPLATE = app
Expand Down
6 changes: 2 additions & 4 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ QT4_ADD_RESOURCES(basketcommon_LIB_SRCS ../basket.qrc)
kde4_add_library(basketcommon SHARED ${basketcommon_LIB_SRCS})

target_link_libraries(basketcommon
${KDE4_KDE3SUPPORT_LIBS} # Remove me
${KDE4_KIO_LIBS}
${KDE4_KDEUI_LIBS}
${KDE4_KPARTS_LIBS}
Expand Down Expand Up @@ -97,7 +96,6 @@ set(basket_SRCS main.cpp mainwindow.cpp application.cpp)

kde4_add_executable(basket ${basket_SRCS})
target_link_libraries(basket
${KDE4_KDE3SUPPORT_LIBS} # Remove me as well
${KDE4_KUTILS_LIBS}
${KDE4_KFILE_LIBS}
${KDE4_PHONON_LIBRARY}
Expand All @@ -111,7 +109,7 @@ set(kcm_basket_PART_SRCS kcm_basket.cpp)

kde4_add_plugin(kcm_basket ${kcm_basket_PART_SRCS})

target_link_libraries(kcm_basket ${QT_QT3SUPPORT_LIBRARY} ${KDE4_KDECORE_LIBS} ${KDE4_KDEUI_LIBS} basketcommon)
target_link_libraries(kcm_basket ${KDE4_KDECORE_LIBS} ${KDE4_KDEUI_LIBS} basketcommon)

install(TARGETS kcm_basket DESTINATION ${PLUGIN_INSTALL_DIR})

Expand All @@ -123,7 +121,7 @@ set(basketpart_PART_SRCS basket_part.cpp)

kde4_add_plugin(basketpart WITH_PREFIX ${basketpart_PART_SRCS})

target_link_libraries(basketpart ${KDE4_KPARTS_LIBS} basketcommon kparts kdeui ${QT_QT3SUPPORT_LIBRARY})
target_link_libraries(basketpart ${KDE4_KPARTS_LIBS} basketcommon kparts kdeui)

install(TARGETS basketpart DESTINATION ${PLUGIN_INSTALL_DIR})

Expand Down
3 changes: 3 additions & 0 deletions src/basketscene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3984,6 +3984,9 @@ void BasketScene::noteEdit(Note *note, bool justAdded, const QPointF &clickedPoi
filterAgain();
unselectAll();
}
// Must set focus to the editor, otherwise edit cursor is not seen and precomposed characters cannot be entered
m_editor->textEdit()->setFocus();

Global::bnpView->m_actEditNote->setEnabled(false);
}

Expand Down
1 change: 1 addition & 0 deletions src/notecontent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1101,6 +1101,7 @@ bool HtmlContent::finishLazyLoad()
if(note()->allowCrossReferences())
convert = Tools::tagCrossReferences(convert);
m_graphicsTextItem.setHtml(convert);
m_graphicsTextItem.setDefaultTextColor(basket()->textColor());
m_graphicsTextItem.setFont(note()->font());
m_graphicsTextItem.setTextWidth(1); // We put a width of 1 pixel, so usedWidth() is egual to the minimum width
int minWidth = m_graphicsTextItem.document()->idealWidth();
Expand Down
4 changes: 4 additions & 0 deletions src/tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,10 @@ QString Tools::htmlToText(const QString &html)
text.replace(" ", " ");
text.replace("&", "&"); // CONVERT IN LAST!!

// HtmlContent produces "\n" for empty note
if (text == "\n")
text = "";

return text;
}

Expand Down

0 comments on commit 647b736

Please sign in to comment.