https://bugs.kde.org/show_bug.cgi?id=372342
Bug ID: 372342 Summary: Face tag area is very short Product: digikam Version: unspecified Platform: Other OS: Linux Status: UNCONFIRMED Severity: normal Priority: NOR Component: Tags Assignee: [hidden email] Reporter: [hidden email] Target Milestone: --- Created attachment 102170 --> https://bugs.kde.org/attachment.cgi?id=102170&action=edit short input field for face tag Face tag input box is very short for full names (see attachment) Probably the best solution to make it change size or make it multi line. -- You are receiving this mail because: You are the assignee for the bug. |
https://bugs.kde.org/show_bug.cgi?id=372342
[hidden email] changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[hidden email] Component|Tags |Faces-Management -- You are receiving this mail because: You are the assignee for the bug. |
In reply to this post by bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=372342
Yingjie Liu <[hidden email]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[hidden email] --- Comment #1 from Yingjie Liu <[hidden email]> --- Hi, I spent about 1 day time compiling the code and installing it(failed to compile on Ubuntu 15 because of exiv2 version problem, then succeeded on Ubuntu 16). After compiled the code, I started to read it and trying to fix the bug. This is the qt working flow about face tag input box: Face tag input box is object of class AssignNameWidget, when user clicked "show face tags" Action, object of AssignNameWidget will be created by class FaceGroup. AssignNameWidget inherits QFrame, the input box is QLineEdit inside the QFrame. QLineEdit can't be made multi line, so I changed the size of QFrame. The attachment "before" shows the input box before I change the width of QFrame. QFrame inherits QWidget, so it can use the method setFixedWidth to change its width. I add the code: q->setFixedWidth(500); in utilities\facemanagement\assignnamewidget.cpp void updateLayout() The input box has been enlarged in width as shown in attachment "after". There may be other solutions, I'd like to talk with you. Thanks! -- You are receiving this mail because: You are the assignee for the bug. |
In reply to this post by bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=372342
--- Comment #2 from Yingjie Liu <[hidden email]> --- Created attachment 104253 --> https://bugs.kde.org/attachment.cgi?id=104253&action=edit before -- You are receiving this mail because: You are the assignee for the bug. |
In reply to this post by bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=372342
--- Comment #3 from Yingjie Liu <[hidden email]> --- Created attachment 104254 --> https://bugs.kde.org/attachment.cgi?id=104254&action=edit after -- You are receiving this mail because: You are the assignee for the bug. |
In reply to this post by bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=372342
--- Comment #4 from [hidden email] --- Hi Lui, The source code place to investigate is good. Hard-coding the size of widget in source code is not the right solution. You don't take a care about font/widget style used in application. Look in this class : https://cgit.kde.org/digikam.git/tree/libs/imageproperties/imagepropertiestxtlabel.h#n90 setLinesNumber() adjust the size of text browser used in Cation/Tags tab from right sidebar. Here the height of text view is adjusted. You can code something similar to adjust the width of face tag widget about an amount of characters. Gilles Caulier The -- You are receiving this mail because: You are the assignee for the bug. |
In reply to this post by bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=372342
--- Comment #5 from Yingjie Liu <[hidden email]> --- Hi, I changed the program based on your tip. The input box will increase by the user input, see attachment “inc1”, “inc2”, “inc3”, “inc4”. The method is as follows: An object of AssignNameWidget will be constructed after the user add the region of face, and it contains an object of AddTagsComboBox. In AddTagsComboBox, there is an AddTagsLineEdit instance “lineEdit”. When the text in lineEdit is changed, it will emit textChanged(const QString& str), I add a slot to handle it: connect(this, SIGNAL(textChanged(QString)), this, SLOT(slotTextChanged(QString))); the slot slotTextChanged(QString) will emit another signal to AddTagsComboBox: void AddTagsLineEdit::slotTextChanged(const QString& txt) { emit textEditChanged(txt); } The AddTagsComboBox class will catch the signal and handle it by sending another signal to AssignNameWidget to tell it the text in lineEdit has changed: connect(d->lineEdit, SIGNAL(textEditChanged(QString)), this, SLOT(slotLineEditTextChanged(QString))); void AddTagsComboBox::slotLineEditTextChanged(const QString& txt) { emit textEditChanged(txt); } In the function void AssignNameWidget::Private::setupAddTagsWidget(T* const widget) of class AssignNameWidget it will handle the signal, I add a line of connect in this function: q->connect(widget, SIGNAL(textEditChanged(QString)), q, SLOT(slotSetLineNumber(QString))); the slot void slotSetLineNumber(const QString & str) will increase the size of input box based on the size of str: void AssignNameWidget::slotSetLineNumber(const QString & str) { int new_width = fontMetrics().width(str); int line_width, del_width = 35; if(d->comboBox) { line_width = d->comboBox->getlineWidth(); } else if(d->lineEdit) { line_width = d->lineEdit->width(); } else { return ; } if(line_width>new_width+del_width) { return ; } else { d->q->setFixedWidth(d->q->width()+new_width-(line_width-del_width)); } } -- You are receiving this mail because: You are the assignee for the bug. |
In reply to this post by bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=372342
--- Comment #6 from Yingjie Liu <[hidden email]> --- Created attachment 104293 --> https://bugs.kde.org/attachment.cgi?id=104293&action=edit inc1 -- You are receiving this mail because: You are the assignee for the bug. |
In reply to this post by bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=372342
--- Comment #7 from Yingjie Liu <[hidden email]> --- Created attachment 104294 --> https://bugs.kde.org/attachment.cgi?id=104294&action=edit inc2 -- You are receiving this mail because: You are the assignee for the bug. |
In reply to this post by bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=372342
--- Comment #8 from Yingjie Liu <[hidden email]> --- Created attachment 104295 --> https://bugs.kde.org/attachment.cgi?id=104295&action=edit inc3 -- You are receiving this mail because: You are the assignee for the bug. |
In reply to this post by bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=372342
--- Comment #9 from Yingjie Liu <[hidden email]> --- Created attachment 104296 --> https://bugs.kde.org/attachment.cgi?id=104296&action=edit inc4 -- You are receiving this mail because: You are the assignee for the bug. |
In reply to this post by bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=372342
--- Comment #10 from [hidden email] --- Please Make a patch against git/master and attach it to this bug entry. I will review and test. Gilles Caulier -- You are receiving this mail because: You are the assignee for the bug. |
In reply to this post by bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=372342
--- Comment #11 from Yingjie Liu <[hidden email]> --- Hi, I tested the code I add, then I find that the width of input box should change only in the FaceItem class. While in the AssignNameOverlay class, it has to be unchanged. So I the connect of signal textEditChanged and slot slotSetLineNumber can only be added in FaceItem class. So I add a function void addTagsChangeSignal() for adding the connect, and it will be invoked in FaceItem class. I commited the code and made a pull request to github, but I did not figure out how to add the patch in this bug entry, should I post some files or use different way to call a pull request? -- You are receiving this mail because: You are the assignee for the bug. |
In reply to this post by bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=372342
--- Comment #12 from Yingjie Liu <[hidden email]> --- Oh, I know. I should use "git format-patch" to generate the patch file after I commit, sorry for less experience. I will take care of it next time. -- You are receiving this mail because: You are the assignee for the bug. |
In reply to this post by bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=372342
--- Comment #13 from [hidden email] --- Note : there is nothing to do with github. It's a read only repository. The real git repository is in KDE server! "git diff > mydiff.patch" Must do the stuff... as it's explained here : https://www.digikam.org/contrib Gilles Caulier -- You are receiving this mail because: You are the assignee for the bug. |
In reply to this post by bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=372342
[hidden email] changed: What |Removed |Added ---------------------------------------------------------------------------- Version|unspecified |5.2.0 -- You are receiving this mail because: You are the assignee for the bug. |
In reply to this post by bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=372342
--- Comment #14 from Yingjie Liu <[hidden email]> --- Hi Gilles, I cloned the repository from KDE server, added my code, compiled it and committed it. However, I can't push it to the server using git. So I do as the tutorial said: https://techbase.kde.org/Development/Tutorials/Git/GitQuickStart#Tell_ssh_to_use_this_key But I can't find a place in my kde account to edit the public ssh keys, so I still can't push the code. Then I read this tutorial: https://community.kde.org/Infrastructure/Get_a_Developer_Account#How_to_get_read-write_access_to_git.2Fsvn As it said, I applied for the KDE developer access (uploaded the ssh keys in applying page) and I set your name as Supporter. Is it necessary to have the KDE developer access to push the code to server? If so, please help my account to have the access. If not, can you tell me another way of how to set to push the code. Thanks! Yingjie Liu -- You are receiving this mail because: You are the assignee for the bug. |
In reply to this post by bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=372342
--- Comment #15 from [hidden email] --- No. You cannot push. You have no right to do it. A developer account is for student selected for GSoC event. Not now... Please make a patch of your difference from your local repository : git diff > mydiff.patch ...and attach this patch to this entry. That all. It's simple no ??? Gilles Caulier -- You are receiving this mail because: You are the assignee for the bug. |
In reply to this post by bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=372342
--- Comment #16 from Yingjie Liu <[hidden email]> --- Created attachment 104335 --> https://bugs.kde.org/attachment.cgi?id=104335&action=edit local code patch for the bug -- You are receiving this mail because: You are the assignee for the bug. |
In reply to this post by bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=372342
--- Comment #17 from [hidden email] --- Comment on attachment 104335 --> https://bugs.kde.org/attachment.cgi?id=104335 local code patch for the bug Why this complex code : + connect(this, SIGNAL(textChanged(QString)), + this, SLOT(slotTextChanged(QString))); + connect(d->completer, static_cast<void(TagCompleter::*)(const TaggingAction&)>(&TagCompleter::activated), [this](const TaggingAction& action){ completerActivated(action); }); @@ -192,6 +195,11 @@ void AddTagsLineEdit::slotTextEdited(const QString& text) d->completer->update(text); } +void AddTagsLineEdit::slotTextChanged(const QString& txt) +{ + emit textEditChanged(txt); +} This code is enough : + connect(this, SIGNAL(textChanged(QString)), + this, SIGNAL(textEditChanged(QString))); and please comment the patch step by step... Gilles Caulier -- You are receiving this mail because: You are the assignee for the bug. |
Free forum by Nabble | Edit this page |