summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/custom_button.cc
Commit message (Collapse)AuthorAgeFilesLines
* Remove redundant casts in g_signal_connect() throughout all gtk code we have.erg@chromium.org2010-02-101-1/+1
| | | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/600033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38629 0039d316-1c4b-4281-b951-d872f2087c98
* GTK: Use themed background images in toolbar buttons.erg@google.com2009-11-111-5/+18
| | | | | | | | | | | | | | When a chrome theme asks to use a background image on a toolbar button, use it. Oddly enough, all of the graphics drawing was written but the plumbing of actually setting the background wasn't... TEST=Good Smile, Chuck Anderson, etc. should have button backgrounds which are very different from the toolbar background in the GTK port. BUG=NONE Review URL: http://codereview.chromium.org/384057 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31728 0039d316-1c4b-4281-b951-d872f2087c98
* Move classes depending on Skia out of base/gfx and into app/gfx. Renamebrettw@chromium.org2009-10-071-1/+1
| | | | | | | | | | native_theme to native_theme_win since its Windows-specific. BUG=none TEST=none Review URL: http://codereview.chromium.org/259047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28300 0039d316-1c4b-4281-b951-d872f2087c98
* Move functions from skia/ext to app/gfx where possible: most of skia_utils.* ↵pkasting@chromium.org2009-09-241-3/+3
| | | | | | | | | | | | | and image_operations.* can be moved because they are not used by WebKit code. This also fixes the spelling of "Convolusion" to "Convolution" and updates some copyrights. This is a re-do of r26975, this time with WebKit update and some fixes to compile on Mac and Linux. BUG=none TEST=none git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27031 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting 26975.pkasting@chromium.org2009-09-231-3/+3
| | | | | | Review URL: http://codereview.chromium.org/222011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26979 0039d316-1c4b-4281-b951-d872f2087c98
* Move functions from skia/ext to app/gfx where possible: most of skia_utils.* ↵pkasting@chromium.org2009-09-231-3/+3
| | | | | | | | | | | | and image_operations.* can be moved because they are not used by WebKit code. This also fixes the spelling of "Convolusion" to "Convolution" and updates some copyrights. BUG=none TEST=none Review URL: http://codereview.chromium.org/207059 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26975 0039d316-1c4b-4281-b951-d872f2087c98
* Reapplies the GdkPixbuf -> cairo surface patch.erg@google.com2009-09-101-39/+50
| | | | | | | | | | | | | Only difference is explicitly calling a FreePerDisplaySurfaces() function from ~GtkThemeProvider() because vtables are set to base class during destructor calling. BUG=http://crbug.com/10499 Original Review URL: http://codereview.chromium.org/197046 Review URL: http://codereview.chromium.org/199077 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25880 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Upload GdkPixbufs into cairo surfaces so they (hopefully) live on the Xerg@google.com2009-09-101-50/+39
| | | | | | | | | | | | | server and have better performance. In the presence of XRender, let cairo do things smarter." Valgrind problems. This reverts commit 03871714c3e5b39ee0f8369ecc2313c02fe0ca08 (r25814). Review URL: http://codereview.chromium.org/200071 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25828 0039d316-1c4b-4281-b951-d872f2087c98
* Upload GdkPixbufs into cairo surfaces so they (hopefully) live on the X ↵erg@google.com2009-09-091-39/+50
| | | | | | | | | | | | | | server and have better performance. In the presence of XRender, let cairo do things smarter. This is a big win performance wise. BrowserWindowGtk::OnCustomFrameExpose, a heavy user of images sped up from an average runtime of 20.5ms to 0.7ms. TEST=Run through valgrind, don't leak memory. TEST=Run both before and after using xtrace. Notice fewer XCreatePixmap requests and more XRender-CreatePicture requests. BUG=http://crbug.com/10499 Review URL: http://codereview.chromium.org/197046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25814 0039d316-1c4b-4281-b951-d872f2087c98
* Add some spacing to titlebar buttons.estade@chromium.org2009-08-051-3/+4
| | | | | | Review URL: http://codereview.chromium.org/160593 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22515 0039d316-1c4b-4281-b951-d872f2087c98
* Linux: convert classes GtkUtil/GtkTreeUtil back to namespaces ↵mdm@chromium.org2009-07-311-1/+1
| | | | | | | | | | | gtk_util/gtk_tree_util. BUG=none TEST=none Review URL: http://codereview.chromium.org/160417 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22130 0039d316-1c4b-4281-b951-d872f2087c98
* Linux: convert namespace gtk_util to class GtkUtil to meet style guidelines.mdm@chromium.org2009-07-301-1/+1
| | | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/160371 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22036 0039d316-1c4b-4281-b951-d872f2087c98
* GTK: Let custom draw buttons specify their stock size as well as their stock ↵estade@chromium.org2009-07-241-6/+8
| | | | | | | | | | | | | image. I tried to also make the tab strip use stock gtk close button but that is gonna require a lot more work to get layout right so leave it alone for now. BUG=none TEST=close button on download shelf is sanely sized Review URL: http://codereview.chromium.org/159325 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21575 0039d316-1c4b-4281-b951-d872f2087c98
* gtk: Theme the tab close button.jhawkins@chromium.org2009-07-241-5/+34
| | | | | | | | BUG=none TEST=Open a browser window. The close button should be visible. Apply a theme with a colored close button. The close button color should match the theme. Review URL: http://codereview.chromium.org/159338 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21542 0039d316-1c4b-4281-b951-d872f2087c98
* GTK Themes: Use the GTK close button in the download shelf and popup ↵erg@google.com2009-07-231-14/+12
| | | | | | | | notification. Review URL: http://codereview.chromium.org/155939 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21394 0039d316-1c4b-4281-b951-d872f2087c98
* GTK Themes: Fixes button state on pressed back/forward buttons and toolbar ↵erg@google.com2009-07-211-14/+22
| | | | | | | | | | | | | | | | | items. This patch fixes two related problems: 1) Holding down back/forward now stay pressed while the menu is shown. 2) Buttons on the "toolbar" now emulate GTK's toolbar behaviour of only showing the border on hover. http://crbug.com/17308 http://crbug.com/17340 Review URL: http://codereview.chromium.org/159154 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21233 0039d316-1c4b-4281-b951-d872f2087c98
* Work on RTL / BiDi Omnibox.deanm@chromium.org2009-07-161-1/+1
| | | | | | | | | Based on work from Evan Stade. Review URL: http://codereview.chromium.org/155567 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20862 0039d316-1c4b-4281-b951-d872f2087c98
* Restore RTL icons to CustomDrawButtonBase.tc@google.com2009-07-131-9/+8
| | | | | | | | | | Since moving from ResourceBundle to ThemeProvider, we needed to plumb through GetRTLEnabledPixbufNamed in ThemeProvider. Review URL: http://codereview.chromium.org/149483 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20568 0039d316-1c4b-4281-b951-d872f2087c98
* GTK Themes: Refactored to use notifications instead of manual plumbing.erg@google.com2009-07-131-29/+44
| | | | | | | | | | | | - Removes large amounts of plumbing because: - All GtkChromeButtons are constructed from GtkThemeProvider which keeps a reference to all live buttons and sends them theme change notifications. - CustomDrawButtons now subscribe themselves to the BROWSER_THEME_CHANGED notification; this gets rid of a LOT of plubming. - Removes the GtkThemeProperties struct; just pass the theme provider around. - Move all the constants from the themes namespace to class statics, per tony's suggestion Review URL: http://codereview.chromium.org/149547 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20561 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Revert "Add button tinting to the toolbar buttons.""tc@google.com2009-07-101-27/+69
| | | | | | | | | | | | | This reverts commit r20399 and re-applies the button tinting code. There's a fix for the go button gtk unittest by checking to see if the browser is non-NULL before getting the theme provider. TBR=erg Review URL: http://codereview.chromium.org/155369 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20402 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Add button tinting to the toolbar buttons."tc@google.com2009-07-101-69/+27
| | | | | | | | | | | This reverts commit r20396. TBR=erg Review URL: http://codereview.chromium.org/155367 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20399 0039d316-1c4b-4281-b951-d872f2087c98
* Add button tinting to the toolbar buttons.tc@google.com2009-07-101-27/+69
| | | | | | | | | | | | | | | | Make CustomDrawButtonBase aware of the ThemeProvider. If the theme changes, we reload new pixbufs from the ThemeProvider. This breaks RTL of the toolbar buttons, I'll add that back in a follow up change to BrowserThemeProvider. BUG=15506 TEST=Change themes or set the GTK+ theme. The star button and go button should be tinted according to the theme (other buttons as well if not using GTK+ buttons). Review URL: http://codereview.chromium.org/149432 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20396 0039d316-1c4b-4281-b951-d872f2087c98
* GTK: Initial implementation of using GTK themes, partially based on evan's ↵erg@google.com2009-07-031-17/+40
| | | | | | | | | | | | | | | | | | | | | | | CL 118358. A lot of stuff works: - Colors are picked out of the GTK theme. - Buttons use the current GTK button theme. - We use the user's icon theme. A lot of stuff doesn't: - We could do a better job of picking colors for the skylines. - The omnibox hasn't been touched. - UI that's not part of the toolbar hasn't been touched. - We currently fail on themes like HighContrastInverse. TEST=Under Options>Personal Stuff, click GTK Theme. Colors and widgets should be rendered with the current GTK theme stuff. TEST=With chrome open and in GTK Theme mode, change your GTK theme or icon theme. chrome should pick up on the change immediately and reimport the colors and images. http://crbug.com/13967 Review URL: http://codereview.chromium.org/150176 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19868 0039d316-1c4b-4281-b951-d872f2087c98
* GTK custom frame: Don't show the border when maximized. Enlarge the close ↵estade@chromium.org2009-06-301-1/+9
| | | | | | | | | | | button's clickable area when maximized. BUG= http://crbug.com/14646 and http://crbug.com/15628 TEST=maximize, turn on custom frame. The top right most pixel on the screen should be clickable and should close the window. There should be no border around the web contents. Review URL: http://codereview.chromium.org/150078 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19567 0039d316-1c4b-4281-b951-d872f2087c98
* Add a function to ResourceBundle to allow loading images that will mirror in ↵estade@chromium.org2009-06-251-10/+6
| | | | | | | | | | RTL. Use this function for custom buttons and for the Off the Record avatar. for reference, this will be a bit different than Views, which does it per class rather than per image: http://dev.chromium.org/developers/design-documents/ui-mirroring-infrastructure Review URL: http://codereview.chromium.org/147157 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19309 0039d316-1c4b-4281-b951-d872f2087c98
* Handle RTL layout in the gtk tabstrip.jhawkins@chromium.org2009-06-231-6/+12
| | | | | | | | BUG=none TEST=Open the browser with --lang=he and make sure the tabs are ordered starting from the right. Also, the UI elements in the tabs should be reversed as well. Review URL: http://codereview.chromium.org/147020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19051 0039d316-1c4b-4281-b951-d872f2087c98
* Paint the custom frame border and round the corners.tc@google.com2009-06-181-1/+0
| | | | | | | | | | | | We apply the theme background color to the window and use a NineBox to draw the theme images around the border. BUG=13430 Review URL: http://codereview.chromium.org/131049 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18748 0039d316-1c4b-4281-b951-d872f2087c98
* Paint a focus indication on LinkButtonGtk buttons.estade@chromium.org2009-05-281-9/+3
| | | | | | | | | | | | | Also, rearrange helper code for centering things in hboxes so they don't expand to take up the full vertical space. Also, don't allow focus on gtk_chrome_button buttons. This is to prevent the "Other bookmarks" button from getting focus (which matches windows) and is in line with disallowing focus on all custom chrome buttons (see CustomDrawButton). BUG=12829 TEST=everything should look the same. Also if you tab to focus on a link button (e.g. download shelf's "show all downloads"), it should have a dotted line around the exterior. Review URL: http://codereview.chromium.org/113970 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17132 0039d316-1c4b-4281-b951-d872f2087c98
* Refactor back/forward buttons to their own class. Fix them so the menu pops ↵estade@chromium.org2009-05-261-3/+15
| | | | | | | | | | | up on drags and the buttons look depressed when the menu is showing. BUG=12427 TEST=back/forward button behavior should be as on windows (see bug desc. for details). Review URL: http://codereview.chromium.org/113806 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16898 0039d316-1c4b-4281-b951-d872f2087c98
* Linux: clean up some focus issues.estade@chromium.org2009-05-081-0/+1
| | | | | | | | | | | - Set focus to render view after finishing find. - Make all custom buttons unfocusable. (matches windows chrome) - Let the GtkWindow's default keyhandler run when the child widget fails to handle the key press event. Previously I optimized this out, but it turns out to be necessary because when a tab is pressed while focus is at the boundary of a child widget (e.g. the last button in an infobar) the focus has to traverse to the next child widget (e.g. the render view), and this is handled by the GtkWindow's key handler (and not the infobar's key handler). BUG=8604,11560 Review URL: http://codereview.chromium.org/115113 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15666 0039d316-1c4b-4281-b951-d872f2087c98
* Adds toplevel app/ directory and moves ResourceBundle into it.ben@chromium.org2009-05-051-1/+1
| | | | | | | | | | | No changes to resource bundle yet, just the move to keep this CL as compact as possible. Adds new vcproj and gyp file for app dir. http://crbug.com/11387 Review URL: http://codereview.chromium.org/100354 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15264 0039d316-1c4b-4281-b951-d872f2087c98
* Make the Linux find bar look a bit better.deanm@chromium.org2009-05-041-2/+3
| | | | | | | | | | - Fake some anti-aliasing so the text entry matches the next/prev images. - Match padding pixel perfect with Windows. Review URL: http://codereview.chromium.org/99275 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15217 0039d316-1c4b-4281-b951-d872f2087c98
* Have ResourceBundle own GdkPixbufs.tc@google.com2009-04-161-8/+4
| | | | | | | | | | | | | | | | | This is the same as how ResourceBundle owns the SkBitmaps it loads. This should be faster than before because ResourceBundle will only load each bitmap once and cache the image. Also fix a memory leak in GdkPixbufFromSkBitmap. valgrind says we're not leaking here. BUG=9988 Review URL: http://codereview.chromium.org/67179 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13847 0039d316-1c4b-4281-b951-d872f2087c98
* Make CustomContainerButton a gtk widget.erg@google.com2009-04-091-61/+0
| | | | | | Review URL: http://codereview.chromium.org/62171 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13452 0039d316-1c4b-4281-b951-d872f2087c98
* Implement stop/go button for Linux.willchan@chromium.org2009-04-091-23/+40
| | | | | | | | | | | | | Refactored code out of CustomDrawButton into CustomDrawButtonBase to be shared with GoButtonGtk. Replaced the existing non-togglable go button with GoButtonGtk. Note that tooltip support isn't done yet, as it changes based on the state of the location bar and the go/stop state. Add a simple test. Fix some minor lint errors. BUG=9381 Review URL: http://codereview.chromium.org/62154 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13409 0039d316-1c4b-4281-b951-d872f2087c98
* Basic infobars on linux.estade@chromium.org2009-04-061-0/+11
| | | | | | | | All infobars consist of nothing but a non-functioning close button. Review URL: http://codereview.chromium.org/62070 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13206 0039d316-1c4b-4281-b951-d872f2087c98
* First implementation of a bookmark bar.erg@google.com2009-04-061-8/+11
| | | | | | | | | | | Currently, the bookmark bar only reads state on startup so to see this work, you have to go to a page, click the star button (that isn't hooked up yet either), and then restart chromium. Review URL: http://codereview.chromium.org/60071 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13193 0039d316-1c4b-4281-b951-d872f2087c98
* Change NineBox to render into a GtkWidget. This offers a minor speedup and ↵jhawkins@chromium.org2009-03-261-18/+2
| | | | | | | | simplification of code because we get rid of the pixbuf middleman. Review URL: http://codereview.chromium.org/42620 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12620 0039d316-1c4b-4281-b951-d872f2087c98
* Remove logging.h from cc files that don't use it.thestig@chromium.org2009-03-121-1/+0
| | | | | | Review URL: http://codereview.chromium.org/42155 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11593 0039d316-1c4b-4281-b951-d872f2087c98
* Normalize end of file newlines in chrome/browser/gtk/.deanm@chromium.org2009-03-101-1/+0
| | | | | | | | All files should now end in only a single newline. Review URL: http://codereview.chromium.org/42010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11325 0039d316-1c4b-4281-b951-d872f2087c98
* Draw custom menu buttons properly.evan@chromium.org2009-02-201-36/+91
| | | | | | | | | | This is an iterative process towards code to be proud of; the previous code of mine was horrible, this is less bad, and my next attempt at it will be pretty, I promise. Review URL: http://codereview.chromium.org/28001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10111 0039d316-1c4b-4281-b951-d872f2087c98
* Relocate custom button code to its own files, in anticipation of more changes.evan@chromium.org2009-02-191-0/+88
(Next is to fix the menu buttons.) Review URL: http://codereview.chromium.org/20509 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10053 0039d316-1c4b-4281-b951-d872f2087c98