Filling in Hollow Area Only for Bootstrap Glyphicon - twitter-bootstrap-3

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

Related

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.

XAML Theme Brushes - Switching Dynamically, cursor doesn't change

First Off, I found this extremely useful page on theme brushes:
http://metro.excastle.com/xaml-system-brushes
So Roughly, on startup for WinRT/XAML I am setting my theme brush for a textbox in a stylesheet:
Foreground = TextBoxDisabledForegroundThemeBrush
Background = TextBoxDisabledBackgroundThemeBrush
Which at run time makes the textbox appear as: white border, transparent background and grey text. Which I was hoping it would make it transparent, white border and white text.
On my Tapped event, I change the textbox to:
Foreground = TextBoxButtonPressedForegroundThemeBrush
Background = TextBoxButtonPressedForegroundThemeBrush
Which is supposed to be black background, white text and white border. Which seems right, but the cursor is back and you cannot see it.
First question is, am I doing this right to change my text color? I want to change the textbox so once it is selected it stays a changed color. I think this is correct. But I am not sure if I should be setting Foreground or maybe a Font Style instead?
Unfortunately you can't change caret color so if you want your TextBox editable - you should keep the background white or otherwise light. Otherwise, controlling the look of your control in its various states is best done using VisualStateManager and that is easiest to manipulate using Blend.

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

Tips on implementing a custom UITextView interface on the iPhone?

I am trying to implement a control to edit text that will display the text in multiple colors. None of the solutions I have attempted yet have been good enough.
UITextView cannot accomplish this. All of the text must be the same color.
Using CoreGraphics to draw the text does not allow the text to be selected.
Using a UIWebView, DIV and PRE tags cannot be set to contentEditable on Mobile Safari.
Currently playing with using an off-screen TEXTAREA and an on-screen DIV to show the rendered text. This works pretty well, except supporting all of these at the same time seems impossible: click-to-type, click-to-move-cursor, click-and-hold-select/copy/paste.
Anyone have any tips on this predicament?
I've been trying to find any preexisting library out there that will accomplish this in a good way, to no luck. I'm open to any ideas!
Well, just pulling an idea out of my... let's say hat.
Could you put a transparent UITextfield over a view that draws the text? If the background was clear and the text color was clear the user could not perceive it but it should still respond to all commands. As the user enters and edits text you could draw the results on the view underneath.
I think the selection would work without any modification at all. When the user selected the clear text, it should create the illusion of selecting the drawn text automatically.
Like this one? StyledText http://three20.info/gfx/overview/styledtext.png It's in Three20 .
Here is an idea. I have no idea if it would work.
If you are only using colors, and not styles, the a UIWebView with colored text might layout text in exactly the same way as a UITextView. You could put a UITextView with invisible ink (text and background fully transparent) over a UIWebView and mirror the contents with colors in the html. I assume you can do scrolling with javascript along with the colored layout.