Sitecore: Editing font and font color of a slide title - sitecore8

I have a Carousel on a page with some slides.
The author can edit the slide's content in the experience editor. i.e. He can change the text and the background image.
However, he cannot change the font color through the editor. So the default font-color in the css class, applied to the title field is white. If the author uses an image with a white background, the text is barely visible.
How could I allow the author to change the font color in the experience editor for the slide's title field?
Maybe allow him to choose from a variant of the title field with a different css class? Except, I don't know how to create a variant for the title field.

You have few options here:
Edit the text using Rich Text field edit fame buttons:
Rendering Variants are using default Sitecore field renderers so those edit frame buttons come from Sitecore - we are not customizing those.
Change style of the Page Content which is by default in each Carousel slide. In that way, you can also easily change font colour. You can also use edit frame button but this time on the Carousel itself:
Change style of the whole Carousel - the same approach as above but not for the Page Content but for whole Carousel.
Carousel Slide by default contains Page Content inside which is using variant configured to display fields from carousel slide. You can of course easily change the variant and display whatever you want.
If you need more information's about rendering variants take a look here

Related

How to remove a white background from copy-pasted content in Rich Text Editor in Sitecore?

When I copy and paste my content into Sitecore's Rich text Editor it appears on the white background for some reason.
How can I remove that white background from the copy-pasted content?
Try ctr+shift+v or cmd+shift+v (for mac)
otherwise:
You can manually remove the background color from the copied
content by selecting the content and then clicking on the "Clear
Formatting" button in the formatting toolbar.
You can set the
default background color for the Rich Text Editor to transparent. To
do this, go to the "Appearance" tab in the Rich Text Editor settings
and set the "Background color" field to "Transparent".

Is it possible to extend QColorDialog ui (c++)

I'm trying to make a dialog in QT c++ that asks for a color and some data input in text fields. I wanted to combine the color picker and text fields in the same dialog. Is it possible to somehow extend the QColorDialog to add this extra functionality or is there a better way without making my own color picker widget?

Customise button in QT

I need to create a toggle button in qt and it should look like the below image. It should show the ON image when it is turned on and remain at this state until it is toggled again. It should show the OFF image in the off case. Please help me on this.
You can use images as an icon (sadly, it won't scale with button by default), create a class which would paint those images in the handler for paint event, or you can use those images in QSS stylesheet. QSS is CSS 2.0 analog for Qt's GUI elements.
Note that after using stylesheet all changes to visuals of said element should be done through changes to stylesheet as well.
THose styles can be set through form editor by right-clicking a widget and choosing "Change stylesheet" or through code directly by calling setStyleSheet, depending which workflow you prefer.
button->setStyleSheet(
"QPushButton { border-image: url(:/Resources/chbUnchecked.png); }"
"QPushButton::checked { border-image: url(:/Resources/chbChecked.png); }" );
border-image Scales image to border limits, replacing standard border.There is also a background-image which fills widget's surface with regular repeats.
To limit this change only for checkable buttons:
button->setStyleSheet(
"QPushButton[checkable="true"] { border-image: url(:/Resources/chbUnchecked.png); }"
"QPushButton::checked[checkable="true"] { border-image: url(:/Resources/chbChecked.png); }" );
:/Resources/ is a path within app's resources.
QSS syntax: https://doc.qt.io/Qt-5/stylesheet-syntax.html
Note that QSS have selectors, so it's it have same "Cascading" ability as CSS. You can assign styles bulk based on hierarchical location on GUI, class-inheritances, class names, quasi-states and names.
If you set style above to a window, all instances of QPushButton within that window would have said style. If you define a new class for such Button, you can use its name instead of standard button class, although QSS for base class would apply to it.
the easiest way is to add the on-off images to your project as resources
then set the button as checkable and in its properties set the images to be rendered when is selected or not..(under icon -> selected on and selected off)
of course you have create images with a properly geometry... in the screenshot they look pretty small because I borrow them from your post..
:)

Display image thumbnails with closing button in Qt

I have a widget that should display images that user has chosen (something like they are shown on the screenshot) and I need to allow users to remove images from this widget. Is there already some widget capable of doing this in Qt or I need to implement such widget by myself?
So, basically I need to display a small image with small closing button in top-right corner.
Yeah, you can. Make a custom widget

How to change default widge styles?

I add field like
forms.ChoiceField(widget=forms.Select(choices=OPTIONS, initial=0)
when display, the normal dropdown is replaced with one with a search box on item list, I think that is Django widget?
I had to add the style to set wdith, otherwise, the dropdown will show with width 33px, way too small
But then I need embed those dropdowns into a jquery accordion. I found dropdowns in non-active section will all have width set to 0px. I guess widget set it to 0 after it detects them are hidden.
From A you can tell the dropdown has styles to make it have round corners
From B, you can see the dropdown doesn't show anything, from the html code, I see the width is set to 0px
If I don't apply the accordion, you see all three dropdowns are fine
I am looking for a way to solve this, either make widget not set width that way, or remove widget effect at all.
Any idea?
thanks