Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: ui/base/gtk/tooltip_window_gtk.cc

Issue 8646002: GTK: Port ui/base/gtk to use avoid deprecated API and accessors (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebased version to fix AUTHORS file merge problem Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/base/gtk/gtk_floating_container.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/base/gtk/tooltip_window_gtk.h" 5 #include "ui/base/gtk/tooltip_window_gtk.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 8
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 10
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 gtk_label_set_line_wrap(GTK_LABEL(label_), TRUE); 57 gtk_label_set_line_wrap(GTK_LABEL(label_), TRUE);
58 gtk_container_add(GTK_CONTAINER(alignment_), label_); 58 gtk_container_add(GTK_CONTAINER(alignment_), label_);
59 gtk_widget_show(label_); 59 gtk_widget_show(label_);
60 60
61 // Associates the tooltip window with given widget 61 // Associates the tooltip window with given widget
62 gtk_widget_set_tooltip_window(host_, GTK_WINDOW(window_)); 62 gtk_widget_set_tooltip_window(host_, GTK_WINDOW(window_));
63 } 63 }
64 64
65 // Paints our customized tooltip window. 65 // Paints our customized tooltip window.
66 gboolean TooltipWindowGtk::OnPaint(GtkWidget* widget, GdkEventExpose* event) { 66 gboolean TooltipWindowGtk::OnPaint(GtkWidget* widget, GdkEventExpose* event) {
67 gtk_paint_flat_box(widget->style, 67 GtkAllocation allocation;
68 widget->window, 68 gtk_widget_get_allocation(widget, &allocation);
69 gtk_paint_flat_box(gtk_widget_get_style(widget),
70 gtk_widget_get_window(widget),
69 GTK_STATE_NORMAL, 71 GTK_STATE_NORMAL,
70 GTK_SHADOW_OUT, 72 GTK_SHADOW_OUT,
71 NULL, 73 NULL,
72 widget, 74 widget,
73 "tooltip", 75 "tooltip",
74 0, 0, 76 0, 0,
75 widget->allocation.width, 77 allocation.width,
76 widget->allocation.height); 78 allocation.height);
77 79
78 return FALSE; 80 return FALSE;
79 } 81 }
80 82
81 // Style change handler. 83 // Style change handler.
82 void TooltipWindowGtk::OnStyleSet(GtkWidget* widget, 84 void TooltipWindowGtk::OnStyleSet(GtkWidget* widget,
83 GtkStyle* previous_style) { 85 GtkStyle* previous_style) {
86 GtkStyle* style = gtk_widget_get_style(widget);
84 gtk_alignment_set_padding(GTK_ALIGNMENT(alignment_), 87 gtk_alignment_set_padding(GTK_ALIGNMENT(alignment_),
85 widget->style->ythickness, 88 style->ythickness,
86 widget->style->ythickness, 89 style->ythickness,
87 widget->style->xthickness, 90 style->xthickness,
88 widget->style->xthickness); 91 style->xthickness);
89 92
90 gtk_widget_queue_draw(widget); 93 gtk_widget_queue_draw(widget);
91 } 94 }
92 95
93 } // namespace ui 96 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/gtk/gtk_floating_container.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698