Commit Graph

86 Commits

Author SHA1 Message Date
Stefan Schimanski
c81e3a0203 * use base color for layout list background. Qt docs say:
QPalette::Base:	Used mostly as the background color for text
entry widgets, but can also be used for other painting - such as the
background of combobox drop down lists and toolbar handles. It is
usually white or another light color.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23660 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-11 10:29:14 +00:00
Stefan Schimanski
361d4d9a16 * simplified layout list a lot by subclassing QItemDelegate instead of
trying to simulate a menu with a QListView (that's what QComboBox does
on some platforms, but not on all).


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23654 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-10 23:00:53 +00:00
Stefan Schimanski
e627e6fb53 * remove style, left from debugging
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23646 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-10 18:44:28 +00:00
Stefan Schimanski
c6fff07103 * patch by Pavel to make the layout list look like it used to be in 1.5.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23644 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-10 17:11:14 +00:00
Stefan Schimanski
3be96448d5 * use small font for the header metrics
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23640 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-10 15:43:47 +00:00
Stefan Schimanski
3e8e012355 * compile fix
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23639 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-10 15:42:35 +00:00
Stefan Schimanski
06a5803eab * reduce spacing in layout list
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23638 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-10 15:41:30 +00:00
Stefan Schimanski
edf9667025 * center RTF text vertically correctly in layout list
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23635 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-10 14:44:40 +00:00
Stefan Schimanski
feb96b01aa * draw full line for empty categories
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23627 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-10 13:10:10 +00:00
Stefan Schimanski
473091fb82 * center the line in the layout category headers in the middle of the lowercase chars
* some messages for the statusbar
    * configuration option for grouping of the layouts
    * put category headers above the first item of each category in the
      layout list.
      To avoid scrolling we have to sneak in space for the headers.
      So we tweak this value accordingly. It's not nice, but the
      only possible way it seems.

    Note 1: Because QComboBox uses the "first row's height * rowCount" to
    estimate the height of the popup, we have to fake some extra pixel
    lines to avoid scrolling because of the extra space taken by the
    headers. This is a hack, but I don't see a better way to establish that.

    Note 2: An alternative implementation is to insert headers as real list
    items. But it seems that QListView cannot skip them in cursor
    navigation then. So we stick to the upper approach.

    * remove checkbox in layout menu


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23626 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-10 13:02:57 +00:00
André Pönitz
be624b3de0 less string conversions as long as we stay in the frontend
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23552 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-08 07:59:47 +00:00
Richard Heck
a01cb111a0 Change the interface to a paragraph's layout. We still store a LayoutPtr, but now privately, and make a Layout const & available to clients.
The need for a LayoutPtr arises from the fact that (a) we do not want to give our clients a Layout &, since we do not want them to be able to change our Layout; but (b) we also need to be able to change which layout is ours. So we cannot store a Layout const &. Or so it seems to the compiler.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23522 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-06 21:31:27 +00:00
Richard Heck
f401ce5d29 Changes LayoutList from a vector<LayoutPtr> to a vector<Layout>.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23519 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-06 20:01:30 +00:00
Richard Heck
592f951ba0 Kill indexing into the list of layouts.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23505 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-06 05:59:21 +00:00
Richard Heck
ac89b178de Simplify the logic a bit here.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23504 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-06 05:10:04 +00:00
Uwe Stöhr
32a3ce2546 GuiToolbar.cpp: compile fixes
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23492 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-05 22:41:56 +00:00
Stefan Schimanski
e636df4610 * preparation for the layout categories. Now the separator is just
drawn above the "-- Separator --" line. As soon as the category
  information is available the same code will draw the separator at
  every category change in the list.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23489 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-05 20:43:55 +00:00
Stefan Schimanski
cdf8979160 * cosmetic
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23485 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-05 19:00:26 +00:00
Stefan Schimanski
bf96153185 * is.at is const, is[] is a deep non-const copy
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23484 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-05 19:00:11 +00:00
Stefan Schimanski
107faacf0e * clear filter when showing popup of layout list
* show filter hint in status bar


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23481 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-05 16:02:18 +00:00
Stefan Schimanski
791b82457d * cosmetic
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23479 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-05 13:07:01 +00:00
Stefan Schimanski
00bcfe78bd * adjust layout list size to contents
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23478 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-05 12:26:50 +00:00
Stefan Schimanski
d749ce138d * cosmetic
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23477 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-05 12:04:46 +00:00
Stefan Schimanski
cafaf075e5 * even when sorted alphabetically keep the separation of standard and module layouts
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23476 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-05 12:02:18 +00:00
Stefan Schimanski
1247839690 * draw the separator as a menu separator
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23475 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-05 12:02:00 +00:00
Stefan Schimanski
2280e16db4 * let the cleanlook style show the check mark. It normally ignores it for comboboxes.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23474 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-05 12:01:40 +00:00
Stefan Schimanski
6da3d44268 * Leave page size at it is to avoid strange layout effects on Mac
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23473 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-05 12:01:27 +00:00
Stefan Schimanski
9c05593876 * rich text item delegate to draw the layout filter as underline
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23472 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-05 12:00:56 +00:00
Stefan Schimanski
4423a8a6f5 * sorting depends on translated string, i.e. column 0 of the layout model
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23429 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-04 09:54:53 +00:00
Stefan Schimanski
b36c8ae173 * fix sorting of layout names
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23428 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-04 09:47:11 +00:00
Stefan Schimanski
cabd59db2c * cosmetic
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23427 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-04 09:46:49 +00:00
Stefan Schimanski
3931ff3f2e * custom keyboard search/filter which shows only those layouts whose
names include the entered character sequence in the same order. 


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23426 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-04 09:46:35 +00:00
Richard Heck
d8a6b5bfd0 Remove TextClassPtr without losing the type safety it provided.
See these threads:
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg136112.html
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg136062.html
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg135997.html
for some background.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23299 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-28 01:42:02 +00:00
Richard Heck
5a45ef653b Improve comment.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23201 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-24 22:42:27 +00:00
Richard Heck
0362c6aae7 Andre's s/getTextClass/textClass/ cleanup.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23190 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-24 15:06:35 +00:00
Richard Heck
2e7d1199df Revert 23154.
Sorry, Andre, but this broke not only the modules stuff but the general handling of TextClasses. I'm not opposed to doing this sort of thing, but it's going to be a little more complicated. I'll do it when I get a bit of time, or I can explain what the issue is here if you want to do it.

I'll separately re-commit some of the cleanup here.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23189 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-24 14:59:23 +00:00
André Pönitz
0fb8f3fba1 mostly s/Paragraph::layout(...)/Paragraph::setLayout(...)/
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23159 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-23 16:45:38 +00:00
André Pönitz
b306e9a2e1 Replace the text class shared ptr by good old index-into-global-list.
Also a few cosmetical changes where I xould not resist.

Would be nice if the 'modules people' could verify that their baby 
is strill alive... 



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23154 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-23 11:36:15 +00:00
Abdelrazak Younes
2bf1c09376 header cleanup
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23049 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-18 07:14:42 +00:00
Richard Heck
040f3431e7 Fix bug 4037 and related problems. The patch has been cleaned up a bit
from the one posted to the list.

The basic idea has two parts. First, we hard code an "empty layout"
(called PlainLayout, for want of a better name) in TextClass and read it
before doing anything else. It can therefore be customized by classes,
if they want---say, to make it left-aligned. Second, InsetText's are
divided into three types: (i) normal ones, that use the "default" layout
defined by the text class; (ii) highly restrictive ones, such as ERT and
(not quite an inset) table cells, which demand the empty layout; (iii)
middling ones, which default to an empty layout and use the empty layout
in place of the default. (This is so we don't get the same problem we
had with ERT in e.g. footnotes.) The type of inset is signaled by new
methods InsetText::forceEmptyLayout() and InsetText::useEmptyLayout().
(The latter might better be called: useEmptyLayoutInsteadOfDefault(),
but that's silly.) The old InsetText::forceDefaultParagraphs() has been
split into these, plus a new method InsetText::allowParagraphCustomization(). 
A lot of the changes just adapt to this change.

The other big change is in GuiToolbar: We want to show LyXDefault and
the "default" layout only when they're active.

There are a handful of places where I'm not entirely sure whether we
should be using forceEmptyLayout or !allowParagraphCustomization() or
both. The InsetCaption is one of these. These places, and some others,
are marked with FIXMEs, so I'd appreciate it if people would search
through the patch and let me know whether these need changing. If they
don't, the FIXMEs can be deleted.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22966 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-12 17:31:07 +00:00
Abdelrazak Younes
fadf8ba12e * GuiLayoutBox: fix initial readonly disabled state and small cleanups.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22845 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-07 16:46:19 +00:00
Richard Heck
d4a87d0dce Some comments about a better way to do things.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22760 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-03 08:51:58 +00:00
Pavel Sanda
75a5c1c7a1 Correct toolbar environment sorting for other locales.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22634 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-19 23:46:03 +00:00
Pavel Sanda
c0414bef66 Environment toolbar is not updated after selection by mouse.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22633 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-19 23:36:03 +00:00
Abdelrazak Younes
689d5c2b99 add some const.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22611 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-17 09:19:52 +00:00
Abdelrazak Younes
ff588411af Delay IconPalette construction.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22610 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-17 08:42:28 +00:00
Abdelrazak Younes
139802b193 string optimizations.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22609 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-17 08:32:48 +00:00
Abdelrazak Younes
0aead96461 Introduce class MenuButton in order to delay the math menu button initialisation up until it is first shown. This improve the inital loading time by half a second on windows.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22608 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-17 08:20:22 +00:00
Edwin Leuven
4559120e8a don't update parent and make sure the icon sizes on the palette are correct
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22606 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-16 20:51:00 +00:00
Edwin Leuven
9a0570de4a initialize iconpalettes only when the user asks for them
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22605 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-16 20:36:45 +00:00