quassel.git
14 years agoFix QSS syntax
Manuel Nickschas [Mon, 24 Aug 2009 19:18:27 +0000 (21:18 +0200)]
Fix QSS syntax

We want #netsplit-join rather than #netsplitJoin, and #netsplit-quit
rather than #netsplitQuit.

14 years agoMake netsplits pretty on clientside
Sebastian Goth [Mon, 24 Aug 2009 16:03:09 +0000 (18:03 +0200)]
Make netsplits pretty on clientside

14 years agoHandle very short netsplits
Sebastian Goth [Mon, 24 Aug 2009 16:01:27 +0000 (18:01 +0200)]
Handle very short netsplits

14 years agoIntroduce netsplit detection/handling
Sebastian Goth [Thu, 30 Jul 2009 15:33:44 +0000 (17:33 +0200)]
Introduce netsplit detection/handling

14 years agoDon't wrap the input line (really this time!)
Manuel Nickschas [Mon, 24 Aug 2009 08:48:23 +0000 (10:48 +0200)]
Don't wrap the input line (really this time!)

Really.

14 years agoAdd -fno-strict-aliasing to CFLAGS
Manuel Nickschas [Sun, 23 Aug 2009 12:31:28 +0000 (14:31 +0200)]
Add -fno-strict-aliasing to CFLAGS

Apparently Qt < 4.6 breaks strict aliasing rules, which makes gcc-4.4 complain loudly when compiling
Quassel (and possibly leads to spurious errors). Hence, for now we disable strict aliasing.

14 years agoMove Clickable out of ContentsChatItem
Manuel Nickschas [Sat, 22 Aug 2009 16:29:43 +0000 (18:29 +0200)]
Move Clickable out of ContentsChatItem

We want to reuse this for the URL handling in the topic widget, so move this out of
ChatIteminto its own class (with proper encapsulation) and file.

As (the also new) ClickableList extends QList<Clickable>, we can continue to use it as
normal.

14 years agoDon't enable wordwrap for the input widget
Manuel Nickschas [Sat, 22 Aug 2009 15:36:56 +0000 (17:36 +0200)]
Don't enable wordwrap for the input widget

14 years agomore cs updates
Tomáš Chvátal [Sat, 22 Aug 2009 12:21:48 +0000 (14:21 +0200)]
more cs updates

14 years agoRedesign the topic widget
Manuel Nickschas [Fri, 21 Aug 2009 22:06:44 +0000 (00:06 +0200)]
Redesign the topic widget

This replaces the old ugly hackish topicwidget by something cleaner. We now use a stacked widget to switch
between display and edit mode. In edit mode, we use a MultiLineEdit rather than a single QLineEdit.
Instead of doing voodooish resizing of the parent widget, we use proper sizeHints and sizePolicies that make
Qt's layout system actually work with this.

There are still some features missing though, notably clickable URLs and the clear button. Will
be implemented ASAP.

Closes #506, fixes #573, closes #608.

14 years agoIntroducing StyledLabel
Manuel Nickschas [Fri, 21 Aug 2009 22:02:26 +0000 (00:02 +0200)]
Introducing StyledLabel

This widget evolved from TopicLabel and provides a QFrame that contains a mIRC-formatted string
(e.g. it accepts mIRC's format codes in the input). Rather than the old drag-to-scroll behavior,
this widget provides a tooltip. It also uses proper QTextLayouts instead of assembling text snippets
manually.

Note that URLs are not yet clickable. This will be added later.

14 years agoAdd ResizingStackedWidget
Manuel Nickschas [Fri, 21 Aug 2009 21:57:15 +0000 (23:57 +0200)]
Add ResizingStackedWidget

This extends QStackedWidget by adding a dynamic sizeHint that only depends on the
currently selected page. Geometry is updated on page change. Use this widget if you want
a stacked container that dynamically adapts to the size of the visible page only rather than
caring for all the pages. Note that pages should have QSizePolicy::Ignore for this to work properly.

14 years agoSlightly improve behavior on resize
Manuel Nickschas [Fri, 21 Aug 2009 21:54:57 +0000 (23:54 +0200)]
Slightly improve behavior on resize

14 years agoRename setters to be more Qt-like
Manuel Nickschas [Wed, 19 Aug 2009 06:51:54 +0000 (08:51 +0200)]
Rename setters to be more Qt-like

Also add a setter for enabling wordwrap in the MultiLineEdit. Will be needed
for the topic widget.

14 years agoUpdate cs.ts
Tomáš Chvátal [Fri, 21 Aug 2009 17:02:10 +0000 (19:02 +0200)]
Update cs.ts

14 years agoAdd a settingspage for configuring the input widget
Manuel Nickschas [Tue, 18 Aug 2009 21:19:20 +0000 (23:19 +0200)]
Add a settingspage for configuring the input widget

Centralize the now-scattered input-line related settings in their own settingspage;
also add some new options.

14 years agoBring back old inputline history behavior
Manuel Nickschas [Tue, 18 Aug 2009 12:29:32 +0000 (14:29 +0200)]
Bring back old inputline history behavior

Cursor down now again always saves the current line in history and starts a new one.
Brought back from the dead by user request.

14 years agoImprove inputline behavior
Manuel Nickschas [Mon, 17 Aug 2009 20:54:38 +0000 (22:54 +0200)]
Improve inputline behavior

* Don't show scrollbars in single line mode
* Don't update geometry more often than necessary
* Allow selecting text with shift + up/down

14 years agochange highlight regexp boundaries from \b to \W
Daniel Albers [Wed, 12 Aug 2009 22:45:00 +0000 (00:45 +0200)]
change highlight regexp boundaries from \b to \W

fixes #708
\b is between \w\W or \W\w, therefore doesn't match "^nickname^ something" due to "^ " being \W\W characters

14 years agoBuild on Qt 4.4 again
Manuel Nickschas [Sun, 16 Aug 2009 13:01:48 +0000 (15:01 +0200)]
Build on Qt 4.4 again

14 years agoDon't show the header widget in bufferviews
Manuel Nickschas [Sun, 16 Aug 2009 11:06:53 +0000 (13:06 +0200)]
Don't show the header widget in bufferviews

This just wastes valuable space and looks ugly.

14 years agoIntroduce multi-line editing for the inputline
Manuel Nickschas [Sun, 16 Aug 2009 10:58:07 +0000 (12:58 +0200)]
Introduce multi-line editing for the inputline

This introduces the new MultiLineEdit that basically enhances the old InputLine widget by being
able to expand to show more than one line. All non-editing related things have been moved out of the
MultiLineEdit to ease reuse in other widgets. For example, InputWidget-specific keypresses are now handled
in InputWidget rather than MultiLineEdit.

Closes #209, closes #213, fixes #386. Thanks to Squider for input (I saw your patch too late, but I did refactor
things anyway...)

14 years agoDon't set a default font for the chatview
Manuel Nickschas [Thu, 13 Aug 2009 18:16:43 +0000 (20:16 +0200)]
Don't set a default font for the chatview

14 years agoDisable unchecked font widget
Manuel Nickschas [Wed, 12 Aug 2009 22:53:14 +0000 (00:53 +0200)]
Disable unchecked font widget

14 years agoshow correct core start time in coreinfodlg
Daniel Albers [Wed, 12 Aug 2009 21:38:32 +0000 (23:38 +0200)]
show correct core start time in coreinfodlg

14 years agos/Buffer/Chat/g
Manuel Nickschas [Wed, 12 Aug 2009 18:50:29 +0000 (20:50 +0200)]
s/Buffer/Chat/g

This removes the mention of "Buffer" from the UI, as it was confuzzling users and making our Usability Queen
unhappy. It has been replaced by "Chat", which might not always be as precise, but should make more sense for users.
A "Buffer View" is now a "Chat List", and in some cases, "Window" has been used (e.g. the "Status Buffer" is now
a "Status Window" - which, again, isn't really the correct term, but probably makes more sense to people not used
to cli-based chat clients.

Obviously, within the code and the DB everything is still a Buffer (and it'll stay that way).

14 years agoChange defaults for some ChatView-related settings
Manuel Nickschas [Wed, 12 Aug 2009 18:04:42 +0000 (20:04 +0200)]
Change defaults for some ChatView-related settings

Since we don't have settings.qss on a new install, we cannot enable things by default.
User must manually enable them and apply the dialog for generating the stylesheet.

14 years agoMove "Appearance" to "Interface" in settingspages
Manuel Nickschas [Wed, 12 Aug 2009 15:47:52 +0000 (17:47 +0200)]
Move "Appearance" to "Interface" in settingspages

This makes more sense, as not all settings concern only the appearance of things.
It's more about how the interface looks and acts like.

14 years agoRemove FontsSettingsPage - hasn't been used in months
Manuel Nickschas [Wed, 12 Aug 2009 15:04:39 +0000 (17:04 +0200)]
Remove FontsSettingsPage - hasn't been used in months

14 years agoMore sensible default color for unread messages
Manuel Nickschas [Wed, 12 Aug 2009 08:11:15 +0000 (10:11 +0200)]
More sensible default color for unread messages

14 years agoDon't merge all custom formats with the base format
Manuel Nickschas [Wed, 12 Aug 2009 07:09:23 +0000 (09:09 +0200)]
Don't merge all custom formats with the base format

This was needed at some point, but now it just screws up things. Should make
combinations (like "color and bold") work again properly.

14 years agoMake all color values work
Manuel Nickschas [Wed, 12 Aug 2009 07:04:32 +0000 (09:04 +0200)]
Make all color values work

Note to self: shifting an uint without explicit typecast might well end up
in a signed int.

14 years agoMake URLs stylable and fix on-hover underline
Manuel Nickschas [Tue, 11 Aug 2009 21:45:56 +0000 (23:45 +0200)]
Make URLs stylable and fix on-hover underline

You can now use ::url in stylesheets to define how URLs should look like.
Default is palette(link) which uses the system color for that purpose. Since this
is applied after layouting, you shouldn't use attributes that change the font geometry.

14 years agoDon't set application stylesheet if no Qt-specific sections are found
Manuel Nickschas [Mon, 10 Aug 2009 11:50:08 +0000 (13:50 +0200)]
Don't set application stylesheet if no Qt-specific sections are found

14 years agoshame on me...
Marcus Eggenberger [Sun, 9 Aug 2009 16:41:40 +0000 (18:41 +0200)]
shame on me...

14 years agofixes #764 - client crashes on lines from nicks like "__"
Marcus Eggenberger [Sat, 8 Aug 2009 10:33:57 +0000 (12:33 +0200)]
fixes #764 - client crashes on lines from nicks like "__"
Nicks consisting only of underscores are no longer treated as a variant of some basename.

14 years agoMake compile without webkit again
Manuel Nickschas [Fri, 7 Aug 2009 08:06:08 +0000 (10:06 +0200)]
Make compile without webkit again

14 years agoAdapt to new topic message type
Manuel Nickschas [Thu, 6 Aug 2009 20:48:19 +0000 (22:48 +0200)]
Adapt to new topic message type

14 years agoInstall a default stylesheet
Manuel Nickschas [Thu, 6 Aug 2009 17:56:10 +0000 (19:56 +0200)]
Install a default stylesheet

This adds basic formatting and should make Quassel usable out of the box.
Colors shamelessly stolen from Konversation by now (same colors as the settingspage
defaults); improvements welcome!

14 years agoAdd new ItemView settingspage
Manuel Nickschas [Thu, 6 Aug 2009 17:00:30 +0000 (19:00 +0200)]
Add new ItemView settingspage

This can be used to define custom colors and fonts for the chat list and nick list.
As with the ChatView, only basic things are settable here; more complex stuff requires
a custom stylesheet.

14 years agoAdd itemview styles to generated settings.qss
Manuel Nickschas [Thu, 6 Aug 2009 16:59:22 +0000 (18:59 +0200)]
Add itemview styles to generated settings.qss

14 years agoThrow out unneeded font setters, adapt to ItemViewSettings
Manuel Nickschas [Thu, 6 Aug 2009 16:58:57 +0000 (18:58 +0200)]
Throw out unneeded font setters, adapt to ItemViewSettings

14 years agoUse state="channel-event" rather than "event" to make things more obvious
Manuel Nickschas [Thu, 6 Aug 2009 16:57:31 +0000 (18:57 +0200)]
Use state="channel-event" rather than "event" to make things more obvious

14 years agoAdd and use ItemViewSettings
Manuel Nickschas [Thu, 6 Aug 2009 16:52:46 +0000 (18:52 +0200)]
Add and use ItemViewSettings

Also, this allows us to use UiStyleSettings with a subgroup.

14 years agoMake custom ChatView font disableable
Manuel Nickschas [Tue, 4 Aug 2009 07:44:04 +0000 (09:44 +0200)]
Make custom ChatView font disableable

Add a checkbox for it, now that we can.

14 years agoRemove label from FontSelector
Manuel Nickschas [Tue, 4 Aug 2009 07:42:46 +0000 (09:42 +0200)]
Remove label from FontSelector

Earlier the FontSelector had its own label, which in retrospect was a stupid idea.
Much better to just consider the demo widget and choose button parts of the FontSelector
widget and have settingspages supply their own description label - or checkbox.

This makes it much easier to have a font disableable, without introducing the need for
multi-property autowidgets.

14 years agoVarious fixes for the style engine
Manuel Nickschas [Mon, 3 Aug 2009 22:53:58 +0000 (00:53 +0200)]
Various fixes for the style engine

This should iron out the last remaining buggy corner cases. I hope.

14 years agoDon't put loaded formats directly in the format cache
Manuel Nickschas [Mon, 3 Aug 2009 21:54:53 +0000 (23:54 +0200)]
Don't put loaded formats directly in the format cache

Bad... idea.

14 years agoHonor disableDecoration() again
Manuel Nickschas [Mon, 3 Aug 2009 18:29:51 +0000 (20:29 +0200)]
Honor disableDecoration() again

14 years agoStyle NickView via UiStyle
Manuel Nickschas [Mon, 3 Aug 2009 17:41:29 +0000 (19:41 +0200)]
Style NickView via UiStyle

NickView now asks UiStyle for appropriate Qt::ItemDataRoles for styling its items,
including the item icons.
This replaces the need for custom delegates altogether.

14 years agoStyle BufferView via UiStyle
Manuel Nickschas [Mon, 3 Aug 2009 17:39:12 +0000 (19:39 +0200)]
Style BufferView via UiStyle

BufferView now asks UiStyle for appropriate Qt::ItemDataRoles for styling its items,
including the item icons.
This replaces the need for setting the palette of custom delegates.

14 years agoProvide means for styling itemviews via UiStyle
Manuel Nickschas [Mon, 3 Aug 2009 17:35:45 +0000 (19:35 +0200)]
Provide means for styling itemviews via UiStyle

QssParser now parses ChatListItem { } and NickListItem { } with "type" and "state"
properties to allow defining styles for BufferView and NickView.

The formats are provided via Qt::ItemRoles, for a given networkmodel index. This allows
for easy access from the itemviews.

14 years agoMake UiStyle accessible from the uisupport module
Manuel Nickschas [Mon, 3 Aug 2009 17:32:29 +0000 (19:32 +0200)]
Make UiStyle accessible from the uisupport module

This provides GraphicalUi::uiStyle() to access UiStyle from widgets in uisupport.

14 years agoIntroduce extra Palette roles for UiStyle
Manuel Nickschas [Thu, 30 Jul 2009 21:23:29 +0000 (23:23 +0200)]
Introduce extra Palette roles for UiStyle

In particular BufferView and NickView use several colors that can't be expressed properly
by QPalette roles. We thus introduce various UiStyle::ColorRoles which can be used by the UI and
defined via stylesheets (as usual, in Palette {} blocks).

14 years agoTweak ChatItem/ChatLine layouting
Manuel Nickschas [Thu, 30 Jul 2009 19:27:30 +0000 (21:27 +0200)]
Tweak ChatItem/ChatLine layouting

This makes the scene react properly to dataChanged() signals from the MessageModel. Only affected
ChatLines are relayouted, the rest moved as appropriately. We can now also call updateGeometryByWidth()
with unchanged width to force a relayout in case the style has changed.

14 years agoMake setData() work for the FlagsRole
Manuel Nickschas [Thu, 30 Jul 2009 19:26:06 +0000 (21:26 +0200)]
Make setData() work for the FlagsRole

14 years agoDon't try to mark all incoming messages with the Backlog flag
Manuel Nickschas [Thu, 30 Jul 2009 19:21:44 +0000 (21:21 +0200)]
Don't try to mark all incoming messages with the Backlog flag

This was an ugly workaround the need for which went away when BacklogManager was introduced.
Anyway, setData() with the FlagsRole was ignored by MessageModelItem...

14 years agoUpdate ChatView properly on style changes
Manuel Nickschas [Thu, 30 Jul 2009 15:45:52 +0000 (17:45 +0200)]
Update ChatView properly on style changes

Since we have the cached wraplists back for the moment, we need to invalidate the caches
for all ChatLineModelItems before relayouting the scene. So instead of having each ChatView trigger
the layout change for his scene, we now inform the ChatLineModel itself, which invalidates its
items' caches and then emits a dataChanged() signal that is caught by the scenes.

14 years agoRevert "Remove the word boundary cache"
Manuel Nickschas [Thu, 30 Jul 2009 15:10:55 +0000 (17:10 +0200)]
Revert "Remove the word boundary cache"

We'll look into those issues again later. For now prevent performance degradation.

This reverts commit 94f4e9d385d32eb1bb8fbf1c9736ca3ccc31cdd6.

14 years agoRevert "Introduce a timer for resizing the ChatView"
Manuel Nickschas [Thu, 30 Jul 2009 15:10:05 +0000 (17:10 +0200)]
Revert "Introduce a timer for resizing the ChatView"

We'll look into those issues again later. For now prevent performance degradation.

This reverts commit 63d178b9ca67b7072a05f5afbd12b4eaedd1f17f.

14 years agoInitially display the current color in KColorDialog
Manuel Nickschas [Thu, 30 Jul 2009 09:10:01 +0000 (11:10 +0200)]
Initially display the current color in KColorDialog

When clicking on a ColorButton in KDE, we would start with white rather than
the button's current color.

14 years agoGenerate and load settings.qss
Manuel Nickschas [Thu, 30 Jul 2009 08:56:19 +0000 (10:56 +0200)]
Generate and load settings.qss

ChatViewSettingsPage now generates (via QtUiStyle) a stylesheet representing the
style settings made in the configuration dialog. This makes the ChatView settingspage
fully functional; also, all changes are applied to ChatView immediately.

14 years agoTweak ChatViewSettingsPage
Manuel Nickschas [Thu, 30 Jul 2009 08:54:37 +0000 (10:54 +0200)]
Tweak ChatViewSettingsPage

* Add default sender colors, shamelessly stolen from Konversation for now
* Fix taborder
* Move font/color settings to [QtUiStyle], as we can then cleanly access it

14 years agoStylesheetify the marker line color
Manuel Nickschas [Thu, 30 Jul 2009 08:39:50 +0000 (10:39 +0200)]
Stylesheetify the marker line color

This is now treated as a new palette role "marker-line" and can be set in
a Palette {} section as follows:

Palette { marker-line: #123456; }

14 years agoDon't wrap the timestamp
Manuel Nickschas [Wed, 29 Jul 2009 22:58:51 +0000 (00:58 +0200)]
Don't wrap the timestamp

14 years agoMerge all stylesheet formats with the base format
Manuel Nickschas [Wed, 29 Jul 2009 22:52:21 +0000 (00:52 +0200)]
Merge all stylesheet formats with the base format

14 years agoRemove obsolete methods
Manuel Nickschas [Wed, 29 Jul 2009 22:43:08 +0000 (00:43 +0200)]
Remove obsolete methods

14 years agoPrepare for more than 15 message types
Manuel Nickschas [Wed, 29 Jul 2009 22:39:59 +0000 (00:39 +0200)]
Prepare for more than 15 message types

14 years agoDon't reset FontSelector font on style change
Manuel Nickschas [Wed, 29 Jul 2009 21:50:05 +0000 (23:50 +0200)]
Don't reset FontSelector font on style change

Qt resets the font of all widgets if the application stylesheet is set.
Thus, we intercept the ChangeEvent and restore the custom font for FontSelector.

14 years agoReload stylesheet after changing it in the AppearanceSettingsPage
Manuel Nickschas [Wed, 29 Jul 2009 18:32:09 +0000 (20:32 +0200)]
Reload stylesheet after changing it in the AppearanceSettingsPage

14 years agoAllow reloading stylesheets at runtime
Manuel Nickschas [Wed, 29 Jul 2009 17:16:45 +0000 (19:16 +0200)]
Allow reloading stylesheets at runtime

We can now relayout the ChatScene using ChatScene::layout() and this is used whenever
UiStyle changes. This means that it's now possible to reload stylesheets at runtime and
reflect this in the ChatView without restarting the client.

14 years agoIntroduce a timer for resizing the ChatView
Manuel Nickschas [Wed, 29 Jul 2009 15:49:54 +0000 (17:49 +0200)]
Introduce a timer for resizing the ChatView

This allows for smooth resizing, as the layout is only calculated at most once every 100ms.

14 years agoRemove the word boundary cache
Manuel Nickschas [Wed, 29 Jul 2009 15:31:05 +0000 (17:31 +0200)]
Remove the word boundary cache

This removes the pre-calculation of word boundaries, which we used to speed up chatline height
computation.

This should also fix the wordwrap issues we had with some fonts.

14 years agoAdd configuration option for a custom stylesheet
Manuel Nickschas [Tue, 28 Jul 2009 22:02:19 +0000 (00:02 +0200)]
Add configuration option for a custom stylesheet

Configure -> Appearance now allows you to select a custom stylesheet that should be loaded.
This will override both the default stylesheet and the settings.qss containing your dialog-based
settings; it will be overridden by --qss specified on the command line.

14 years agoMove color and font settings to [Colors] and [Fonts]
Manuel Nickschas [Tue, 28 Jul 2009 21:21:11 +0000 (23:21 +0200)]
Move color and font settings to [Colors] and [Fonts]

Better to keep those separate, rather than lumping them together with all the rest
of the ChatView/__default__ stuff.

14 years agoIntroduce the new ChatViewSettingsPage
Manuel Nickschas [Tue, 28 Jul 2009 15:45:28 +0000 (17:45 +0200)]
Introduce the new ChatViewSettingsPage

This is supposed to group the ChatView-related settings in once place, including fonts
and colors. Oh, and you now also can configure the timestamp format :)

We've reduced the number of configurable colors, simply because more fancy stuff can and should
be done via stylesheets.
Note that the style settings, while stored, are still unbeknownst to the style
engine until we start actually generating stylesheets.

14 years agoMake timestamp configurable in the style engine
Manuel Nickschas [Tue, 28 Jul 2009 15:00:41 +0000 (17:00 +0200)]
Make timestamp configurable in the style engine

The style engine now reads the timestamp format string from the ChatView settings.
This means all that's missing now is a settingspage that offers an UI for changing
the string.

14 years agoMake the Settings caches flat structures
Manuel Nickschas [Tue, 28 Jul 2009 14:58:07 +0000 (16:58 +0200)]
Make the Settings caches flat structures

As settingspages tend to access values by absolute path (rather than by group and key),
we should use a flat hash rather than a nested tree structure, such that caching and
in particular the notifiers work with both the group/key combination and the absolute key.
This should also be slightly more efficient.

14 years agoLet SettingsPage handle FontSelector and ColorButton automatically
Manuel Nickschas [Mon, 27 Jul 2009 23:49:45 +0000 (01:49 +0200)]
Let SettingsPage handle FontSelector and ColorButton automatically

This means that SettingsPages can now handle both FontSelector and ColorButton automatically and
don't have to worry about tracking/saving/loading them. This should save us several hundred lines
of boilerplate code, and also some cute kittens.

I must reiterate that Qt's property system is worth a ton of bacon. At least.

14 years agoAdd a FontSelector widget
Manuel Nickschas [Mon, 27 Jul 2009 23:43:09 +0000 (01:43 +0200)]
Add a FontSelector widget

This handles a label, a demo frame, and a button to choose a font. It's not checkable
at the moment though.

FontSelector uses the property system, so it can be used conveniently.

14 years agoRevamp ColorButton
Manuel Nickschas [Mon, 27 Jul 2009 23:34:59 +0000 (01:34 +0200)]
Revamp ColorButton

Rather than requiring parent widgets using this to connect all sorts of signals and show the
color selection dialog themselves, move this into ColorButton itself, making it a
self-sufficient widget. Also, we're now using the Qt property system, and emit a
colorChanged() signal.

Oh, and we inherit from QToolButton now, which seems to be a saner choice on MacOSX and also
allows for nicer layouts on all platforms. Yes, we'll try and improve the looks later on, right
now it's just a crude QPixmap overlaying the button.

14 years agoDIE DIE DIE ColorSettingsPage
Manuel Nickschas [Mon, 27 Jul 2009 23:31:34 +0000 (01:31 +0200)]
DIE DIE DIE ColorSettingsPage

Finally getting rid of this mess. Most things didn't work anymore anyway
with the new style engine. We'll be setting colors more context-sensitively in the
future (e.g. set the colors for a widget in that widget's settings).

14 years agoMake text selection stylesheetable
Manuel Nickschas [Fri, 24 Jul 2009 04:06:40 +0000 (06:06 +0200)]
Make text selection stylesheetable

This adds a new [label="selected"] that you can use in stylesheets to determine how
a text selection should look like in ChatView (i.e. it's no longer hardcoded to the
"highlight" and "highlighted-text" Palette roles).

Note that you probably shouldn't do more than setting the selection colors globally for
ChatLine, as else the painting routines might do funky stuff.

14 years agoMerge rather than replace identical sections in QSS
Manuel Nickschas [Wed, 22 Jul 2009 23:13:51 +0000 (01:13 +0200)]
Merge rather than replace identical sections in QSS

14 years agoChange handling of message labels
Manuel Nickschas [Wed, 22 Jul 2009 22:12:07 +0000 (00:12 +0200)]
Change handling of message labels

Turns out that it seems to make more sense to apply labels after everything
else, so we can override all formats if a label is set. Also, this prepares
representing selections through message labels rather than special casing in paint().

As a sideeffect, I could simplify the code somewhat and remove duplication.

14 years agoCorrectly handle the font property "underline"
Manuel Nickschas [Wed, 22 Jul 2009 15:14:29 +0000 (17:14 +0200)]
Correctly handle the font property "underline"

14 years agoAdd debug menu entry for reloading the stylesheets
Manuel Nickschas [Thu, 25 Jun 2009 19:22:09 +0000 (21:22 +0200)]
Add debug menu entry for reloading the stylesheets

Hitting the Refresh key (commonly F5) will now reload the stylesheets
and repaint ChatViews. Use this to test color combination without restarting
the client all the time.

14 years agoUpdate ChatViews whenever the stylesheet is reloaded
Manuel Nickschas [Thu, 25 Jun 2009 19:18:59 +0000 (21:18 +0200)]
Update ChatViews whenever the stylesheet is reloaded

UiStyle now emits a signal when loadStyleSheet() (now a slot) is called.
ChatView reacts by invalidating the scene. Note that the ChatLines are not re-layouted,
which means that changes in font sizes and possibly styles might lead to a broken appearance.
This is primarily thought for testing color combinations without restarting the client
all the time.

14 years agoMake UiStyle a QObject
Manuel Nickschas [Thu, 25 Jun 2009 18:32:50 +0000 (20:32 +0200)]
Make UiStyle a QObject

That way we can use signals/slots with it, e.g. emit a signal upon changes in the
style.

14 years agoParse mIRC colors in stylesheets
Manuel Nickschas [Thu, 25 Jun 2009 18:17:13 +0000 (20:17 +0200)]
Parse mIRC colors in stylesheets

Use a condition like [fg-color="03"] or [bg-color="05"] to specify formats for
mIRC colors. We use this more verbose format (rather than adding extra attributes
to ChatLine instead, like "color-03: red;") to allow for maximum flexibility in
styling. The idea is to be able to specify formats e.g. for a particular combination
of foreground and background.

14 years agoRemove C-style comment lines from stylesheets
Manuel Nickschas [Thu, 25 Jun 2009 17:49:40 +0000 (19:49 +0200)]
Remove C-style comment lines from stylesheets

We also now remove all sections we parse and handle from the stylesheet
prior to handing it over to QApplication, so we can use incompatible extensions.

14 years agoAdd --qss parameter to load a custom stylesheet
Manuel Nickschas [Wed, 24 Jun 2009 07:44:38 +0000 (09:44 +0200)]
Add --qss parameter to load a custom stylesheet

Because there doesn't seem to be sane way to hijack Qt's -stylesheet parameter,
we introduce our own. This also allows us to add incompatible extensions to QSS,
because we can remove them before handing over the pre-parsed stylesheet to QApplication.
Note that -stylesheet is now ignored.

The style engine now loads $datadir/default.qss, $configdir/custom.qss and --qss "file.qss"
in that order. Later block declarations override earlier ones, if they are identical.
That way, you can override parts of the system-installed default.qss in your own configdir or
on the command line.

14 years agoParse format parameters in QSS
Manuel Nickschas [Wed, 24 Jun 2009 07:44:21 +0000 (09:44 +0200)]
Parse format parameters in QSS

Adds [format="$fmt"], where $fmt can be one of "bold", "italic",
"underline" and "reverse" corresponding to the respective mIRC format codes.

14 years agofix compile error on non-x86_64
Daniel Albers [Tue, 23 Jun 2009 14:36:48 +0000 (16:36 +0200)]
fix compile error on non-x86_64

14 years agoMake sender-hash based styling ("colored nicks") work again
Manuel Nickschas [Mon, 22 Jun 2009 19:54:35 +0000 (21:54 +0200)]
Make sender-hash based styling ("colored nicks") work again

Plain messages now obtain their format depending on the sender hash.
This can be used to implement colored nicks, but with our new style engine,
we can now solve several problems like using other colors for highlighted messages.

Note that the number of hashed is currently hard-coded to 16; waiting for a nice way
to make this number configurable in a stylesheet.

14 years agoFix QSS font handling
Manuel Nickschas [Sun, 21 Jun 2009 21:38:53 +0000 (23:38 +0200)]
Fix QSS font handling

This fixes some issues with merging font properties in stylesheets.
As a side-effect, we don't parse the "oblique" font style anymore, as this
is not a supported QTextFormat property.

14 years agoRemove highlight-color related settings from QtUiStyle[Settings]
Manuel Nickschas [Sun, 21 Jun 2009 19:58:18 +0000 (21:58 +0200)]
Remove highlight-color related settings from QtUiStyle[Settings]

Since we now use message labels for styling highlighted messages, it's no longer
necessary to have explicit options for this in QtUiStyle.

14 years agoMake backgrounds of ChatLines and ChatItems styleable
Manuel Nickschas [Sun, 21 Jun 2009 19:23:40 +0000 (21:23 +0200)]
Make backgrounds of ChatLines and ChatItems styleable

The background color (set by UiStyle) is now available in the MessageModel
via the BackgroundRole. It is used by the items to paint themselves, if it is
set by a stylesheet.

Message labels (so far, we support "highlight" and "own message") are also respected
properly. They can be accessed via the MsgLabelRole and are now used for accessing the style
engine.

14 years agoAdd a Contents subelement type to ChatLine
Manuel Nickschas [Thu, 18 Jun 2009 20:27:14 +0000 (22:27 +0200)]
Add a Contents subelement type to ChatLine

This allows independent styling of the contents part of a message,
equivalent to the Sender and Timestamp columns.

14 years agoMake UiStyle::styleString() and friends static
Manuel Nickschas [Thu, 18 Jun 2009 08:21:56 +0000 (10:21 +0200)]
Make UiStyle::styleString() and friends static

styleString() actually just converts our internal format codes into a list
of FormatTypes, which are only used as keys for getting a particular format from
a particular style. Hence, styleString() itself can be made static. Amongst other things,
this has the advantage that StyledMessage's lazy styling can be encapsulated properly, and
there is no need to externally ensure that the message has been styled.