vspace ui
What on earth is a vspace of "none" ? Why is it the default ? There are missing tooltips it seems ... (qt) regards john -- Khendon's Law: If the same point is made twice by the same person, the thread is over.
Re: The current char style UI
On Sun, Nov 30, 2003 at 10:44:11PM +0200, Martin Vermeer wrote: > > But since this is really only a halfway > > house to what we really want, that might not be suitable. > > What *do* we/you really want? Well as outlined and discussed some months ago. > > slightly weird to have some completely different UI for handling logical > > styles from physical settings, as we have currently. > > Hmmm perhaps. Did I point out already that I don't really like physical > character attributes? :-) They shouldn't exist at all, but that has some other implications. > I can see your problem though. Having insets is a quite different > paradigm, but is conceptually cleaner and more practical to implement. > IMHO. This is why we have the half-way house :) > An essential difference is that a char attribute can be applied or > unapplied. An inset can only be inserted (i.e., "applied" after > selecting the text to be contained in it.) Exactly ... this is just one of the many problems with a box-based approach visible in the UI (as opposed to a purely internal box paradigm) > Of course code for deleting or "unapplying" an inset (e.g., backspace > in pos 0, like in math) could be created as well. But what you will > never be able to do in this paradigm is "unapplying" a charstyle for a > piece in the middle of an applied charstyle, as you can do with > physical attributes -- or more generally, creating arbitrary bit > patterns of attributes. (But then I would argue "why would you want > to?") Well, I'm sure I could construct a valid use case. regards john -- Khendon's Law: If the same point is made twice by the same person, the thread is over.
Wiki has been restructured, feedback invited
Hi I've restructured the LyX wiki site: http://wiki.lyx.org and would appreciate feedback on the structure. Especially from people who have no idea about what a wiki-wiki is... /Christian -- Christian Ridderström http://www.md.kth.se/~chr
Still src/frontends/xforms/Makefile.am problem
The patch I sent was not fully applied, it looks like. -- Kayvan A. Sylvan | Proud husband of | Father to my kids: Sylvan Associates, Inc. | Laura Isabella Sylvan | Katherine Yelena (8/8/89) http://sylvan.com/~kayvan | "crown of her husband" | Robin Gregory (2/28/92) Index: src/frontends/xforms/Makefile.am === RCS file: /cvs/lyx/lyx-devel/src/frontends/xforms/Makefile.am,v retrieving revision 1.111 diff -u -r1.111 Makefile.am --- src/frontends/xforms/Makefile.am2003/11/30 17:11:50 1.111 +++ src/frontends/xforms/Makefile.am2003/11/30 21:51:21 @@ -194,7 +194,7 @@ @: stamp-xpm: lyx_xpm.h-tmp - if cmp -s $< lyx_xpm.h || {\ + cmp -s $< lyx_xpm.h || {\ rm -f lyx_xpm.h ;\ cp $< lyx_xpm.h ;\ }
Re: [patch] Qt scrolling
-BEGIN PGP SIGNED MESSAGE- On Sonntag, 30. November 2003 19:32, Angus Leeming wrote: > Kornel Benko wrote: > >> Could the Qt-ers amongst you try out the attached patch. It gives > >> you scrolling behaviour similar to that of the xforms frontend. > >> > >> Specifically, if you move the mouse cursor above/below the work > >> area, you should get 'sensible' scrolling behaviour. > >> > >> Try it out and let me know. > > > > 1.) It feels still too fast selecting below the work area. > > > > 2.) If one starts selecting below the area, then the try to deselect > > some parts, i.e. select above, nonetheless continues selecting the > > parts below. (Don't know, if I express myself understandably enough) > > Ok, Kornel, try 2. > * revert yesterday's patch. > * cvs up > * apply the patch attached. Something fishy hier ... 3.57 korben.kornel 22:51 > patch -p0 < '/tmp/kde-kornel/kmailfnaUvb.3/qt.diff' patching file src/frontends/qt2//QContentPane.C Hunk #3 succeeded at 79 with fuzz 2. patching file src/frontends/qt2//QContentPane.h ... > It should fix both problems. If you still think (1) is too fast, could > you play with the '400' ms passed to the timeout in the > SyntheticMouseEvent constructor (QContentPane.h). No need for 400ms now. This patch cured both problems. BTW, I was unable to crash it with pointer selections. Kornel P.S. This mail-delays are going to be too nerving. - -- Kornel Benko [EMAIL PROTECTED] -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux) iQCVAwUBP8pqAbewfbDGmeqhAQEBQAP/U6m26L8e4qie6yZw4n7jy7khAf2qKs98 d4vmSV/gaAvn23EU6Rt3nNU0coZjhTIhHVvZeHiP54h6yUjyLbwm85djPs59oyVL hq44pnDshpBHaXPWlvMjprpgoIz2MwdC+hIBqM9IeRXCK9smzXYcYNfcOHapPS7R iQQl+NBdSB8= =jikl -END PGP SIGNATURE-
Re: A working InsetVSpace
Am Sonntag, 30. November 2003 10:00 schrieb Juergen Spitzmueller: > Georg Baum wrote: > > Apart from that, I get error messages like > > > > Paragraph ended in line 31 > > Missing \end_layout. > > > > if I use the VSpace inset (see attached example). Is this expected (CVS > > from this morning)? I checked the file by hand, the structure seems to > > be correct. > > cannot reproduce (and you forgot to attach the file). Oops. Now really attached. I am using gcc 2.95.4 + stlport. Could this be the problem? Georg #LyX 1.4.0cvs created this file. For more info see http://www.lyx.org/ \lyxformat 225 \textclass article \language english \inputencoding auto \fontscheme default \graphics default \paperfontsize default \papersize Default \paperpackage a4 \use_geometry 0 \use_amsmath 1 \use_natbib 0 \use_numerical_citations 0 \paperorientation portrait \secnumdepth 3 \tocdepth 3 \paragraph_separation indent \defskip medskip \quotes_language english \quotes_times 2 \papercolumns 1 \papersides 1 \paperpagestyle default \tracking_changes 0 \end_header \begin_layout Standard begin \begin_inset VSpace defskip \end_inset \end_layout \begin_layout Standard end \end_layout \end_document
Re: The current char style UI
On Sun, Nov 30, 2003 at 05:30:58PM +, John Levon spake thusly: > It has some real problems IMHO. We need to be careful here. > > What are people's future plans in this regard ? I know its already been > discussed wrt how the inset should look, but I have real issues with > this stuff being in the Insert menu at all. I'd muich rather see text > style being a submenu in Edit. Fine with me! > But since this is really only a halfway > house to what we really want, that might not be suitable. What *do* we/you really want? > But it's > slightly weird to have some completely different UI for handling logical > styles from physical settings, as we have currently. Hmmm perhaps. Did I point out already that I don't really like physical character attributes? :-) I can see your problem though. Having insets is a quite different paradigm, but is conceptually cleaner and more practical to implement. IMHO. An essential difference is that a char attribute can be applied or unapplied. An inset can only be inserted (i.e., "applied" after selecting the text to be contained in it.) Of course code for deleting or "unapplying" an inset (e.g., backspace in pos 0, like in math) could be created as well. But what you will never be able to do in this paradigm is "unapplying" a charstyle for a piece in the middle of an applied charstyle, as you can do with physical attributes -- or more generally, creating arbitrary bit patterns of attributes. (But then I would argue "why would you want to?") > regards > john - Martin pgp0.pgp Description: PGP signature
Re: [patch] Qt scrolling
-BEGIN PGP SIGNED MESSAGE- On Sonntag, 30. November 2003 18:21, Angus Leeming wrote: > Kornel Benko wrote: > > > -BEGIN PGP SIGNED MESSAGE- > > > > On Samstag, 29. November 2003 22:20, Angus Leeming wrote: > >> Could the Qt-ers amongst you try out the attached patch. It gives > >> you scrolling behaviour similar to that of the xforms frontend. > >> > >> Specifically, if you move the mouse cursor above/below the work > >> area, you should get 'sensible' scrolling behaviour. > >> > >> Try it out and let me know. > > 1.) It feels still too fast selecting below the work area. > > Could you try changing the length of the timeout to (say) 400ms from > its current 200ms. See line 81 of QContentPane.C: > > QContentPane::QContentPane(QWorkArea * parent) > : QWidget(parent, "content_pane", WRepaintNoErase), > timeout_(200), track_scrollbar_(true), wa_(parent) > { Much better now. > > 2.) If one starts selecting below the area, then the try to deselect > > some parts, i.e. select above, nonetheless continues selecting the > > parts below. (Don't know, if I express myself understandably enough) > > So, you keep the mouse button pressed, move it below the work area so > that the text starts scrolling and then move it up so that the cursor > is in the work area once again? And the text keeps being scrolled? No, comming back to the work area stops the selections. But, still with the mouse button pressed, move the pointer _abowe_ the work area. Now the automatic selection starts again... in the wrong direction(_not_ diselecting) Kornel - -- Kornel Benko [EMAIL PROTECTED] -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux) iQCVAwUBP8pRrrewfbDGmeqhAQGPMAP/T7mF8o/+hUwKfiPi5bLfr8bAOMKEWyUh fBPyni79hFfhMywdmQMqBiVdoUMdUuTP1IqnSzzrBJYxocWuTLv5BBoCU+d+1o0o J53i5NmYldxj2vzEHi25AkS8S6fsBNr5PjQruVuTIMfnEe8g+jIb1Bb0gc3D6Uhe 5H/pJaw2c/w= =Ap4N -END PGP SIGNATURE-
Caption labels
Reading text2.C "the caption hack", what about creating a routine getCaptionFloatType() returning the type of the float containing the caption, and using that instead of isOK? One could use this routine in lyx_cb.C to augment getPossibleLabel() to provide fig: and tab: for labels in captions. Then again the label name could be used reliably by the xref to derive the type of label... something I would need in AGU (Yes I know, not robust against operator error; but it's a start). - Martin pgp0.pgp Description: PGP signature
Re: [patch] Qt scrolling
Kornel Benko wrote: >> Could the Qt-ers amongst you try out the attached patch. It gives >> you scrolling behaviour similar to that of the xforms frontend. >> >> Specifically, if you move the mouse cursor above/below the work >> area, you should get 'sensible' scrolling behaviour. >> >> Try it out and let me know. > > 1.) It feels still too fast selecting below the work area. > > 2.) If one starts selecting below the area, then the try to deselect > some parts, i.e. select above, nonetheless continues selecting the > parts below. (Don't know, if I express myself understandably enough) Ok, Kornel, try 2. * revert yesterday's patch. * cvs up * apply the patch attached. It should fix both problems. If you still think (1) is too fast, could you play with the '400' ms passed to the timeout in the SyntheticMouseEvent constructor (QContentPane.h). Regards, -- AngusIndex: src/frontends/qt2//QContentPane.C === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/QContentPane.C,v retrieving revision 1.28 diff -u -p -r1.28 QContentPane.C --- src/frontends/qt2//QContentPane.C 30 Nov 2003 18:26:41 - 1.28 +++ src/frontends/qt2//QContentPane.C 30 Nov 2003 18:28:39 - @@ -10,6 +10,10 @@ #include +#include "debug.h" + +#include + #include "QWorkArea.h" #include "QContentPane.h" #include "QLyXKeySym.h" @@ -18,9 +22,6 @@ #include #include -#include "funcrequest.h" - - namespace { /// return the LyX key state from Qt's @@ -78,6 +79,10 @@ QContentPane::QContentPane(QWorkArea * p : QWidget(parent, "content_pane", WRepaintNoErase), track_scrollbar_(true), wa_(parent) { + synthetic_mouse_event_.timeout.timeout.connect( + boost::bind(&QContentPane::generate_synthetic_mouse_event, + this)); + setFocusPolicy(QWidget::WheelFocus); setFocus(); setCursor(ibeamCursor); @@ -89,6 +94,24 @@ QContentPane::QContentPane(QWorkArea * p } +void QContentPane::generate_synthetic_mouse_event() +{ + // Set things off to generate the _next_ 'pseudo' event... + synthetic_mouse_event_.timeout.start(); + + double const scrollbar_value = wa_->scrollbar_->value(); + // Has anything changed on-screen since the last QMouseEvent + // was received? + if (scrollbar_value != synthetic_mouse_event_.scrollbar_value_old) { + // Yes it has. Store the params used to check this. + synthetic_mouse_event_.scrollbar_value_old = scrollbar_value; + + // ... and dispatch the event to the LyX core. + wa_->dispatch(synthetic_mouse_event_.cmd); + } +} + + void QContentPane::scrollBarChanged(int val) { if (track_scrollbar_) @@ -107,6 +130,9 @@ void QContentPane::mousePressEvent(QMous return; } + if (synthetic_mouse_event_.timeout.running()) + synthetic_mouse_event_.timeout.stop(); + FuncRequest cmd(LFUN_MOUSE_PRESS, e->x(), e->y(), q_button_state(e->button())); wa_->dispatch(cmd); @@ -115,6 +141,9 @@ void QContentPane::mousePressEvent(QMous void QContentPane::mouseReleaseEvent(QMouseEvent * e) { + if (synthetic_mouse_event_.timeout.running()) + synthetic_mouse_event_.timeout.stop(); + FuncRequest cmd(LFUN_MOUSE_RELEASE, e->x(), e->y(), q_button_state(e->button())); wa_->dispatch(cmd); @@ -123,9 +152,40 @@ void QContentPane::mouseReleaseEvent(QMo void QContentPane::mouseMoveEvent(QMouseEvent * e) { - FuncRequest cmd - (LFUN_MOUSE_MOTION, e->x(), e->y(), q_motion_state(e->state())); - wa_->dispatch(cmd); + FuncRequest cmd(LFUN_MOUSE_MOTION, e->x() - x(), e->y() - y(), + q_motion_state(e->state())); + + bool const above_or_below_workarea = + e->y() <= y() || e->y() >= y() + height(); + + if (above_or_below_workarea) { + if (synthetic_mouse_event_.timeout.running()) + // Discard event. + return; + + // Store the 'psuedo' event and start the timeout. + synthetic_mouse_event_.cmd = cmd; + synthetic_mouse_event_.timeout.start(); + + } else if (synthetic_mouse_event_.timeout.running()) + // We're interested in generating 'pseudo' events only + // when the cursor is outside of the work-area. + synthetic_mouse_event_.timeout.stop(); + + double const scrollbar_value = wa_->scrollbar_->value(); + // Has anything changed on-screen since the last QMouseEvent + // was received? + if (e->x() != synthetic_mouse_event_.x_old || + e->y() != synthetic_mouse_event_.y_old || + scrollbar_value != synthetic_mouse_event_.scrollbar_value_old) { + // Yes it has. Store the params used to check this. + synthetic_mouse_event_.x_old = e->x(); + synthetic_mouse_event_.y_old = e->y(); + synthetic_mouse_event_.scrollbar_value_old = scrollbar_value; + + // ... and dispatch the event to the LyX core. + wa_->dispatch(cmd); + } } @@ -200,4 +260,3 @@ void QContentPane::trackScrollbar(bool t { track_scrollbar_ = track_on; } - Index: src/frontends/qt2//QContentPane.h === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/QContentPane.
Re: [PATCH] small qbranch fixes and a branch bug
Martin Vermeer wrote: > The attached works for me. Jürgen, could > you verify and check it in if OK (or I can do that too)? Done. Jürgen
Re: Boxes
On Sun, Nov 30, 2003 at 02:35:31PM +0100, Juergen Spitzmueller spake thusly: > Martin, > I think we should add "Minipage" and "Parbox" to the box type lists instead of > "frameless". If the user choses Minipage or Parbox, then the "has inner box" > stuff should be completely disabled. This is certainly possible and fairly straightforward to implement (the last part is already there). Only replace in ControlBox.C the Frameless entry by Parbox and Minipage, and make the necessary adaptations in FormBox.C (lines 56, 130 and 252, I think). insetbox would even become a little simpler. > Otherwise people will bug us because they do not find minipage anymore. The question does arise though, if Minipage and Parbox, which are latexicisms of the worst kind, are any better. Yes, old users familiar with them will wonder (although even they would be hard pressed to state the difference between them...), but 'naive' users will find Frameless more graphic :-), I suspect. Actually I want to put as little obfuscation as possible between the user and what is happening at the LyX low level here. To mix in the same pulldown (1) an esoteric distinction having to do with footnotes IIRC, and (2) what the visible frame looks like, constitutes IMO just such obfuscation. So, I am not saying 'no', but this is the problem I have with this idea. An IMO better compromise idea would be to provide separate, explicit 'Insert Minipage' and 'Insert Parbox' menu entries. Or even only 'Insert Minipage' to make the old guard happy. > > Regards, > Jürgen. - Martin pgp0.pgp Description: PGP signature
Right address is horked
Right Address is completely broken, it's off the left of the screen. Also resizing the window does not resize the document. I've also spotted about 10 new regressions other than that since I last tried LyX, but I suppose they are well known about ... regards john -- Khendon's Law: If the same point is made twice by the same person, the thread is over.
Bug: parse error with Minipage.lyx
Current CVS cannot load Minipage.lyx from examples/ dir correctly. regards john -- Khendon's Law: If the same point is made twice by the same person, the thread is over.
The current char style UI
It has some real problems IMHO. We need to be careful here. What are people's future plans in this regard ? I know its already been discussed wrt how the inset should look, but I have real issues with this stuff being in the Insert menu at all. I'd muich rather see text style being a submenu in Edit. But since this is really only a halfway house to what we really want, that might not be suitable. But it's slightly weird to have some completely different UI for handling logical styles from physical settings, as we have currently. regards john -- Khendon's Law: If the same point is made twice by the same person, the thread is over.
Re: [PATCH] small qbranch fixes and a branch bug
On Sun, Nov 30, 2003 at 11:13:02AM +0100, Juergen Spitzmueller spake thusly: > Martin, I have found a bug in the setSelected() method of BranchList > (reproducable in both frontends): > - create 3 branches named "55", "666" and "6" > - activate branch "6" > => branch "666" is also activated (and deactivated). > > Regards, > Jürgen. Ah, yes. It's line 101 in BranchList.C. Thus should be if (s == it->getBranch()) like in setColor() above. (I remember intending this behaviour as a 'feature' and then forgot about it) Might as well add an assert too. The attached works for me. Jürgen, could you verify and check it in if OK (or I can do that too)? - Martin Index: BranchList.C === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BranchList.C,v retrieving revision 1.8 diff -u -p -r1.8 BranchList.C --- BranchList.C6 Oct 2003 15:41:57 - 1.8 +++ BranchList.C30 Nov 2003 17:17:55 - @@ -98,9 +98,12 @@ void BranchList::setSelected(string cons List::iterator it = list.begin(); List::iterator end = list.end(); for (; it != end; ++it) { - if (s.find(it->getBranch(), 0) != string::npos) + if (s == it->getBranch()) { it->setSelected(val); + return; + } } + BOOST_ASSERT(false); } pgp0.pgp Description: PGP signature
Re: [patch] Qt scrolling
Kornel Benko wrote: > -BEGIN PGP SIGNED MESSAGE- > > On Samstag, 29. November 2003 22:20, Angus Leeming wrote: >> Could the Qt-ers amongst you try out the attached patch. It gives >> you scrolling behaviour similar to that of the xforms frontend. >> >> Specifically, if you move the mouse cursor above/below the work >> area, you should get 'sensible' scrolling behaviour. >> >> Try it out and let me know. > > 1.) It feels still too fast selecting below the work area. Could you try changing the length of the timeout to (say) 400ms from its current 200ms. See line 81 of QContentPane.C: QContentPane::QContentPane(QWorkArea * parent) : QWidget(parent, "content_pane", WRepaintNoErase), timeout_(200), track_scrollbar_(true), wa_(parent) { > 2.) If one starts selecting below the area, then the try to deselect > some parts, i.e. select above, nonetheless continues selecting the > parts below. (Don't know, if I express myself understandably enough) So, you keep the mouse button pressed, move it below the work area so that the text starts scrolling and then move it up so that the cursor is in the work area once again? And the text keeps being scrolled? Hmmm, interesting. -- Angus
Re: src/frontends/xforms/Makefile.am diff
Kayvan A. Sylvan wrote: > This fixes the "make install" problem: D'oh! Thanks. -- Angus
Re: [PATCH] lengthcombo
John Levon wrote: > Looks fine, thanks (but "for (i = 0;" not "for (i=0;" please) Oh, sure. I'll commit then tomorrow. I had to do another small change to avoid "index out of range" warnings (see below: num -= 1). Jürgen. void LengthCombo::noPercents() { int num = QComboBox::count(); for (int i = 0; i < num; i++) { if (QComboBox::text(i).contains("%") > 0) { QComboBox::removeItem(i); i -= 1; num -= 1; } } }
Re: [PATCH] lengthcombo
On Sun, Nov 30, 2003 at 11:55:18AM +0100, Juergen Spitzmueller wrote: > I have added a method noPercents() to lengthcombo, which allows to use the Looks fine, thanks (but "for (i = 0;" not "for (i=0;" please) thanks john -- Khendon's Law: If the same point is made twice by the same person, the thread is over.
Boxes
Martin, I think we should add "Minipage" and "Parbox" to the box type lists instead of "frameless". If the user choses Minipage or Parbox, then the "has inner box" stuff should be completely disabled. Otherwise people will bug us because they do not find minipage anymore. Regards, Jürgen.
Re: [patch] Qt scrolling
-BEGIN PGP SIGNED MESSAGE- On Samstag, 29. November 2003 22:20, Angus Leeming wrote: > Could the Qt-ers amongst you try out the attached patch. It gives you > scrolling behaviour similar to that of the xforms frontend. > > Specifically, if you move the mouse cursor above/below the work area, > you should get 'sensible' scrolling behaviour. > > Try it out and let me know. 1.) It feels still too fast selecting below the work area. 2.) If one starts selecting below the area, then the try to deselect some parts, i.e. select above, nonetheless continues selecting the parts below. (Don't know, if I express myself understandably enough) Kornel - -- Kornel Benko [EMAIL PROTECTED] -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux) iQCVAwUBP8noZLewfbDGmeqhAQG6AwQAndNffbovvyDXUcj6v7X5Dt6hGzBs9hNK hA+ol4pvueoz29kOv+g2MkYGp9ocvqCNP1yTd+Ks7A5f+KHMwjgRRf3KS/HYPeIJ NxTHbS6JgRvTRj6vHFsPKUUFFo7u7I+EASrijme6ZnOVC4tlBhNM/s3nrJPoJx9C RltQ87c7zyk= =6Uev -END PGP SIGNATURE-
[PATCH] lengthcombo
John, I have added a method noPercents() to lengthcombo, which allows to use the lengthcombo widget without the %-items (text% and friends). With this, we can use lengthcombo for all length unit combos, including those who should not contain %-items (VSpace for instance). This also allows to use the qt_helpers widgetsToLength() etc (which really simplifies the code a lot). Currently, we already have some lengthcombos which should not contain %-items, but do: paragraphSkip in documents (results in a LaTeX error) and papersize (falls back to A4 afaics). I'm not sure about margins. It does not produce an error, but xforms does not have %-items. The former two are fixed with the patch. Opinions? Jürgen. Index: src/frontends/qt2/QDocument.C === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/QDocument.C,v retrieving revision 1.63 diff -u -r1.63 QDocument.C --- src/frontends/qt2/QDocument.C 21 Nov 2003 11:38:16 - 1.63 +++ src/frontends/qt2/QDocument.C 30 Nov 2003 10:40:51 - @@ -114,6 +114,9 @@ cb->insertItem(qt_("B3")); cb->insertItem(qt_("B4")); cb->insertItem(qt_("B5")); + // remove the %-items from the unit choice + dialog_->pageLayoutModule->paperwidthUnitCO->noPercents(); + dialog_->pageLayoutModule->paperheightUnitCO->noPercents(); // layout for (LyXTextClassList::const_iterator cit = textclasslist.begin(); @@ -141,6 +144,8 @@ dialog_->textLayoutModule->skipCO->insertItem(qt_("MedSkip")); dialog_->textLayoutModule->skipCO->insertItem(qt_("BigSkip")); dialog_->textLayoutModule->skipCO->insertItem(qt_("Length")); + // remove the %-items from the unit choice + dialog_->textLayoutModule->skipLengthCO->noPercents(); dialog_->pageLayoutModule->pagestyleCO->insertItem(qt_("default")); dialog_->pageLayoutModule->pagestyleCO->insertItem(qt_("empty")); Index: src/frontends/qt2/QVSpace.C === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/QVSpace.C,v retrieving revision 1.2 diff -u -r1.2 QVSpace.C --- src/frontends/qt2/QVSpace.C 29 Nov 2003 17:25:30 - 1.2 +++ src/frontends/qt2/QVSpace.C 30 Nov 2003 10:40:52 - @@ -155,13 +155,7 @@ bcview().addReadOnly(dialog_->keepCB); // remove the %-items from the unit choice - int num = dialog_->unitCO->count(); - for (int i=0; i < num; i++) { - if (dialog_->unitCO->text(i).contains("%") > 0) { - dialog_->unitCO->removeItem(i); - i -= 1; - } - } + dialog_->unitCO->noPercents(); } Index: src/frontends/qt2/lengthcombo.C === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/lengthcombo.C,v retrieving revision 1.15 diff -u -r1.15 lengthcombo.C --- src/frontends/qt2/lengthcombo.C 7 Sep 2003 01:45:38 - 1.15 +++ src/frontends/qt2/lengthcombo.C 30 Nov 2003 10:40:52 - @@ -50,3 +50,15 @@ { QComboBox::setEnabled(b); } + + +void LengthCombo::noPercents() +{ + int num = QComboBox::count(); + for (int i=0; i < num; i++) { + if (QComboBox::text(i).contains("%") > 0) { + QComboBox::removeItem(i); + i -= 1; + } + } +} Index: src/frontends/qt2/lengthcombo.h === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/lengthcombo.h,v retrieving revision 1.8 diff -u -r1.8 lengthcombo.h --- src/frontends/qt2/lengthcombo.h 23 Aug 2003 00:16:39 - 1.8 +++ src/frontends/qt2/lengthcombo.h 30 Nov 2003 10:40:53 - @@ -31,6 +31,8 @@ LyXLength::UNIT currentLengthItem() const; /// enable the widget virtual void setEnabled(bool b); + /// use the %-items? + virtual void noPercents(); protected slots: virtual void has_activated(int index);
[PATCH] small qbranch fixes and a branch bug
The attached patch - fixes the color display of colorless branches. I.e. do not use any color item at all in the browser (instead of white) - implements double click for (de)activating branches If I get no objections, this will go in on monday. Martin, I have found a bug in the setSelected() method of BranchList (reproducable in both frontends): - create 3 branches named "55", "666" and "6" - activate branch "6" => branch "666" is also activated (and deactivated). Regards, Jürgen. Index: src/frontends/qt2/ChangeLog === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/ChangeLog,v retrieving revision 1.613 diff -u -r1.613 ChangeLog --- src/frontends/qt2/ChangeLog 29 Nov 2003 17:25:30 - 1.613 +++ src/frontends/qt2/ChangeLog 30 Nov 2003 10:11:39 - @@ -1,3 +1,9 @@ +2003-11-30 Juergen Spitzmueller <[EMAIL PROTECTED]> + + * QDocumentDialog.[Ch]: (branches) don't insert a coloritem + for colorless branches; implement double click for (de)activating + branches. + 2003-11-29 Juergen Spitzmueller <[EMAIL PROTECTED]> * qt_helpers.C (widgetsToLength): handle glue lengths Index: src/frontends/qt2/QDocumentDialog.C === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/QDocumentDialog.C,v retrieving revision 1.41 diff -u -r1.41 QDocumentDialog.C --- src/frontends/qt2/QDocumentDialog.C 29 Nov 2003 17:25:30 - 1.41 +++ src/frontends/qt2/QDocumentDialog.C 30 Nov 2003 10:11:40 - @@ -167,6 +167,8 @@ connect(branchesModule->addBranchPB, SIGNAL(pressed()), this, SLOT(addBranchPressed())); connect(branchesModule->removePB, SIGNAL(pressed()), this, SLOT(deleteBranchPressed())); connect(branchesModule->activatePB, SIGNAL(pressed()), this, SLOT(toggleBranchPressed())); + connect(branchesModule->branchesLV, SIGNAL(doubleClicked(QListViewItem *)), this, + SLOT(branchDoubleClicked(QListViewItem *))); connect(branchesModule->colorPB, SIGNAL(clicked()), this, SLOT(toggleBranchColor())); branchesModule->branchesLV->setSorting(0); } @@ -433,15 +435,17 @@ QString const bname = toqstr(all[i].c_str()); QString const sel = (params.branchlist().selected(fromqstr(bname))) ? qt_("Yes") : qt_("No"); - QColor itemcolor(white); + QListViewItem * newItem = +new QListViewItem(branchesModule->branchesLV, bname, sel); + QColor itemcolor; string x11hexname = params.branchlist().getColor(fromqstr(bname)); if (x11hexname[0] == '#') itemcolor.setNamedColor(toqstr(x11hexname)); - QPixmap coloritem(30, 10); - coloritem.fill(itemcolor); - QListViewItem * newItem = -new QListViewItem(branchesModule->branchesLV, bname, sel); - newItem->setPixmap(2, coloritem); + if (itemcolor.isValid()) { +QPixmap coloritem(30, 10); +coloritem.fill(itemcolor); +newItem->setPixmap(2, coloritem); + } } } form_->branchlist_ = params.branchlist(); @@ -483,11 +487,23 @@ void QDocumentDialog::toggleBranchPressed() { + QListViewItem * selItem = + branchesModule->branchesLV->selectedItem(); + toggleBranch(selItem); +} + + +void QDocumentDialog::branchDoubleClicked(QListViewItem * selItem) +{ + toggleBranch(selItem); +} + + +void QDocumentDialog::toggleBranch(QListViewItem * selItem) +{ ControlDocument & cntrl = form_->controller(); BufferParams & params = cntrl.params(); - QListViewItem * selItem = - branchesModule->branchesLV->selectedItem(); QString sel_branch; if (selItem != 0) sel_branch = selItem->text(0); Index: src/frontends/qt2/QDocumentDialog.h === RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/QDocumentDialog.h,v retrieving revision 1.20 diff -u -r1.20 QDocumentDialog.h --- src/frontends/qt2/QDocumentDialog.h 23 Oct 2003 11:58:00 - 1.20 +++ src/frontends/qt2/QDocumentDialog.h 30 Nov 2003 10:11:41 - @@ -43,6 +43,7 @@ void updateFontsize(std::string const &, std::string const &); void updatePagestyle(std::string const &, std::string const &); void updateBranchView(); + void toggleBranch(QListViewItem * selItem); void showPreamble(); @@ -64,6 +65,7 @@ void addBranchPressed(); void deleteBranchPressed(); void toggleBranchPressed(); + void branchDoubleClicked(QListViewItem * selItem); void toggleBranchColor(); protected:
Re: A working InsetVSpace
Georg Baum wrote: > The dialog works, but there seems to be an encoding problem, the umlauts in > your and Andrés names appear as question marks. I have fixed this (eventually I must consider using a *real* editor).. > Apart from that, I get error messages like > > Paragraph ended in line 31 > Missing \end_layout. > > if I use the VSpace inset (see attached example). Is this expected (CVS > from this morning)? I checked the file by hand, the structure seems to be > correct. cannot reproduce (and you forgot to attach the file). Jürgen.