Hangouts chat - Change message background color based on hashtag - hangouts-chat

I want to change the background colour of the message based on the hashtag mentioned.
For example:
Red for #high
Green for #medium
Yellow for #low
Can it be done using Hangouts API?

No, you cannot do this.
As you can see in the official documentation, there is no way to change the background color of a message, even from a Card message. At most, you can format text via this list of HTML tags. But as you can see, this does not include background color. You could also add an image with the color you desire, but it wouldn't be a background color either (it would take its own space and would not occupy all card message as a background).
If you think this would be an interesting functionality, you can submit a new feature request in Issue Tracker, using this template. Just make sure this request has not been made before by looking through this list of issues.

Related

Filling in Hollow Area Only for Bootstrap Glyphicon

I'm using Bootstrap glyphicons for a web app and love the flexibility of being able to leverage them as fonts, since that's what they are, not graphics. However, I'm running into a challenge with the glyphicon-remove-sign icon, which has a colored circle surrounding an otherwise empty "x". I like the default look of the black surrounding the "x" and want to use it to close a rounded-cornered iframe. But, because that "x" is empty, it displays whatever is behind it:
Ideally, I'd want to have that hollow "x" be a different color like white, easy enough to do with background colors, except that creates a box around the otherwise vectored font and looks unsightly for my usage, which has multiple colors to contend with behind the icon:
The question is: is there a way to just fill in the empty space inside the hollow area of this glyphicon without this kludgy-looking box? I looked at using a clip-path with the background color, but that won't work with IE. I welcome any recommendations anyone may have for a fix here -- thanks in advance.
create a wrapper div of the glyphicon, give it border-radius as to imitate the circle streching it and then give that background color

Custom button in Windows 8.1 app

I have a requirement to create a button in a Windows 8.1 app which has an icon and a text label. The icon will be a symbol from Segoe UI Symbols and the text label will be Segoe UI Semibold at a smaller text size.
I want to be able to reuse the button in different places within the app, using different icons and text labels.
How show I go about this? I could create a button and then edit the ContentPresenter to have a horizontally oriented stack panel with two TextBlocks, but then how could I reuse this? And how could I change the text in the two different text blocks?
Should I create a separate custom control with separate dependency properties for each of the textblock strings? I'm interested in hearing what you would do.
thanks
Create a simple Style. To make it easy, I would base it off the standardized AppBarButton style. You can format it to whatever size you want (I have done something similar to make a larger button or one with text on the side).
Have the main icon simply be a ContentPresenter which binds to the Content using a TemplateBinding. Make sure to set the FontFamily to Segoe UI Symbol. Have the text label pull from AutomationProperties.Name, similar to how the AppBarButton style does.
Then, whenever you want to use this just do:
<Button Style="{StaticResource MyCustomButtonStyle}"
Content="" // Where "000" is replaced by the number of the icon you wish to use.
AutomationProperties.Name="Text Label"/>
This should be extensible and easily reproducible to whatever location you need. When copying over the AppBarButton style, I suggest removing the artificial size limits (specifically the width of the main content Grid). I do suggest either giving the Text Label a fixed size or having it pull its size from the specified parent Width, so that it will Wrap correctly.
Hope this helps and happy coding!
Are you desiring to create something like for an AppBar? Take a look at AppBarButton and the style/types it supports. In Windows 8.1 we added some things around SymbolIcon specifically. Since you basically want two pieces of 'content' for your style you'll have to re-purpose one property (unless you create a custom control which doesn't sound needed for this scenario). Using AutiomationProperties.Name for the visible label is a good idea because it will also help with accessibility by default for those users.
Investigate the style for AppBarButton to get you started.

live tiles in Windows Phone and Grids

I'm trying to create a live tile for my application, using a user control.
The user control contains a grid, an image and a rectangle filled with color.
Now here comes the funny part.
I want the rectangle to act as a background for the tile's title, and the image to fill the rest of the tile. And i said to myself, well, lets put some rows in that grid and set the like you usually set them in a WPF/SL application.
I then write the entire thing in a WBM and save it to isostore.
The problem is, the parser seems to ignore the presence of grid's rows. regardless of what I try, the rectangle is not shown, and the image covers the full tile, when it should only cover the first row. It is as if the grid didn't even existed.
Another funny aspect is that it doesn't matter if I use rows or columns, the result is the same.
Any ideas?
Are you using the following method?
Dynamic LiveTile - adding background image?
I recently implemented a Live Tile using a Grid with Rows and Columns for layout of some TextBlocks. I encountered similar challenges, so I placed the control that I was using for my Live Tile on a blank page in my app to better see what was happening. Does the control render correctly when displayed on a page (versus being rendered to a WriteableBitmap)?
Another idea. Instead of trying to position the Rectangle relative to the tile's Title, why not leave the Title property blank and put the same text in a TextBlock within the user control?
If you are careful about the font and positioning of the TextBlock, the text on the resulting background image can appear indistinguishable from text displayed from the Title property. I decided to follow this strategy myself. I found the font information in the following answer:
Font size and family for a tile's title
Otherwise, could you post an example of the XAML you are using?

Background color of a Gtk.TextView - can't see selection

I successfully changed the background color of a Gtk.TextView (GTK3) with method override_background_color:
color.parse(self.settings.get_string("bgcolor"))
self.ui.NoteView.override_background_color(Gtk.StateType.NORMAL,color)
I also override the foreground color.
Unfortunatelly in that case making a selection in the text is invisible.
How can I modify the background and foreground color of a TextView without loosing the visible text selecting?
It's best to format the text in a GtkTextView by using GtkTextTags. You can apply any sort of text formatting(background & foreground colors, font, size, weight, etc..) to any portion of the text.
Click here for an example.
Hope that helps!
By the way, what you're doing is changing the style of your TextView. In Gtk it's best to stay away from doing this, especially if you aren't in a controlled environment or plan on releasing your software for others to use, because gtk's philosophy is to leave the styling and theming up to the end user for their own personal touches/needs.
This is why you are getting some unwanted results by overriding style colors.
In terms of a GtkTextView it does however offer simple formatting of the text(even support for adding images/widgets) via use of GtkTextTags as the link shows above.

Chameleon site, changing site's color with the color selector

I want to learn how can i design a site which background and images color will be changeable by the user. Colors could change by only one color within 4 colors such as green, blue, white etc. in the sites such as msn, yahoo etc. But, there was no effects like drop shadow or gradient overlay in that images. However, I want to change color of images which applied effects such as drop shadow, gradient overlay. Moreover, with each color. Just like chameleon.
I can put a text link on the right of the top. A color selector like at Photoshop can open, when the user clicked this link. Color selector generates a hex code according to selected color. Color of site changes to color which the user selected.
I changed an image background color which is transparent by using JavaScript DOM. Color of transparent area in the image will be the same with the background color of div tag which contains this image. But, if the image has got effects like shadow, overlay etc., the changing color will be disable.
How can I do it, and which technology will I use, jQuery, Ajax? How I create a site which color could change.How I create a site which color will be changeable by the user.
Just like chameleon...
Hmm, well this might take a while to implement, if you're starting with little knowledge.
My suggestion, to get you started, is to have a javascript which changes the class of the body element according to a selection the user makes. So let's say I visit the page, the <body> tag has no class, and default css is used.
Then I click on the link to make things red. Using javascript, or jquery, give the body the class "red-body".
Have css in your stylesheet which only works for elements which are children of an element with this class.
Html:
Go Red
jQuery
$('.go-red').click(function(){$('body').removeClass();$('body').addClass('red-body');});
So if you have code like:
#navigation li{color:#000;}
.red-body #navigation li{color: #af000;}
This will make this possible. This means you can do it all with just one stylesheet, which I think is the best way.
There are a number of ways to store the users choice. One of the easiest ways is to set a cookie in their browser. You can do this with javascript, here's the introduction from w3schools: http://www.w3schools.com/JS/js_cookies.asp