Fix building on Linux

This commit is contained in:
Cheng Zhao 2017-04-17 17:17:02 +09:00
parent 97fd383c53
commit b3d60bfb3a
10 changed files with 28 additions and 24 deletions

View file

@ -41,7 +41,7 @@ class GtkMessageBox : public NativeWindowObserver {
const gfx::ImageSkia& icon)
: cancel_id_(cancel_id),
checkbox_checked_(false),
parent_(static_cast<NativeWindowViews*>(parent_window)) {
parent_(static_cast<NativeWindow*>(parent_window)) {
// Create dialog.
dialog_ = gtk_message_dialog_new(
nullptr, // parent
@ -94,7 +94,7 @@ class GtkMessageBox : public NativeWindowObserver {
// Parent window.
if (parent_) {
parent_->AddObserver(this);
parent_->SetEnabled(false);
static_cast<NativeWindowViews*>(parent_)->SetEnabled(false);
libgtkui::SetGtkTransientForAura(dialog_, parent_->GetNativeWindow());
gtk_window_set_modal(GTK_WINDOW(dialog_), TRUE);
}
@ -104,7 +104,7 @@ class GtkMessageBox : public NativeWindowObserver {
gtk_widget_destroy(dialog_);
if (parent_) {
parent_->RemoveObserver(this);
parent_->SetEnabled(true);
static_cast<NativeWindowViews*>(parent_)->SetEnabled(true);
}
}
@ -179,7 +179,7 @@ class GtkMessageBox : public NativeWindowObserver {
bool checkbox_checked_;
NativeWindowViews* parent_;
NativeWindow* parent_;
GtkWidget* dialog_;
MessageBoxCallback callback_;

View file

@ -4,6 +4,9 @@
#include "atom/browser/ui/views/global_menu_bar_x11.h"
// There are conflicts between Xlib.h and this header.
#include "atom/browser/native_window_views.h" // NOLINT
#include <X11/Xlib.h>
// This conflicts with mate::Converter,
@ -15,7 +18,6 @@
#include <dlfcn.h>
#include <glib-object.h>
#include "atom/browser/native_window_views.h"
#include "atom/browser/ui/atom_menu_model.h"
#include "base/logging.h"
#include "base/strings/stringprintf.h"

View file

@ -36,7 +36,7 @@ SubmenuButton::SubmenuButton(const base::string16& title,
if (GetUnderlinePosition(title, &accelerator_, &underline_start_,
&underline_end_))
gfx::Canvas::SizeStringInt(GetText(), GetFontList(), &text_width_,
gfx::Canvas::SizeStringInt(GetText(), gfx::FontList(), &text_width_,
&text_height_, 0, 0);
SetInkDropMode(InkDropMode::ON);
@ -107,8 +107,8 @@ bool SubmenuButton::GetUnderlinePosition(const base::string16& text,
void SubmenuButton::GetCharacterPosition(
const base::string16& text, int index, int* pos) {
int height = 0;
gfx::Canvas::SizeStringInt(text.substr(0, index), GetFontList(), pos, &height,
0, 0);
gfx::Canvas::SizeStringInt(text.substr(0, index), gfx::FontList(), pos,
&height, 0, 0);
}
} // namespace atom