diff --git a/program/MainWindow.cs b/program/MainWindow.cs index 83c5453..6d60b9f 100644 --- a/program/MainWindow.cs +++ b/program/MainWindow.cs @@ -662,16 +662,32 @@ private bool ConfirmPowerOff() { - var dlg = new MessageDialog(this, - DialogFlags.Modal | DialogFlags.DestroyWithParent, - MessageType.Question, ButtonsType.None, - "{0}", _Language["Close.ConfirmPowerOff"]); + var dlg = new Dialog(); + dlg.Name = "PowerOffDialog"; + dlg.TransientFor = this; + dlg.Modal = true; + dlg.Decorated = false; // matchbox gives no useful frame + dlg.TypeHint = Gdk.WindowTypeHint.Dialog; + dlg.WindowPosition = WindowPosition.CenterOnParent; + dlg.SetDefaultSize(780, 320); - dlg.AddButton(_Language["Common.Cancel"], (int)ResponseType.Cancel); - dlg.AddButton(_Language["Common.PowerOff"], (int)ResponseType.Ok); + var msg = new Label(_Language["Close.ConfirmPowerOff"]); + msg.Name = "PowerOffMessage"; + msg.LineWrap = true; + msg.Justify = Justification.Center; + + Box content = dlg.ContentArea; + content.Spacing = 0; + content.PackStart(msg, true, true, 0); + + var cancel = (Button)dlg.AddButton(_Language["Common.Cancel"], (int)ResponseType.Cancel); + var ok = (Button)dlg.AddButton(_Language["Common.PowerOff"], (int)ResponseType.Ok); + cancel.Name = "PowerOffCancel"; + ok.Name = "PowerOffConfirm"; dlg.DefaultResponse = ResponseType.Cancel; - var r = (ResponseType)dlg.Run(); + dlg.ShowAll(); + ResponseType r = (ResponseType)dlg.Run(); dlg.Destroy(); return r == ResponseType.Ok; } diff --git a/program/info_eng.csv b/program/info_eng.csv index c0094d3..2a4c5f0 100644 --- a/program/info_eng.csv +++ b/program/info_eng.csv @@ -29,4 +29,8 @@ ConnectionAlertLabel,Problem connecting with device BatteryIcon.Charging,Battery {0}% — charging BatteryIcon.Discharging,Battery {0}% -BatteryIcon.Full,Battery fully charged \ No newline at end of file +BatteryIcon.Full,Battery fully charged +Close.ConfirmPowerOff,Shut down the tablet? +Close.ShuttingDown,Shutting down... +Common.Cancel,Cancel +Common.PowerOff,Shut Down \ No newline at end of file diff --git a/program/info_jpn.csv b/program/info_jpn.csv index c3c5735..41e131f 100644 --- a/program/info_jpn.csv +++ b/program/info_jpn.csv @@ -29,4 +29,8 @@ ConnectionAlertLabel,デバイスに接続できません BatteryIcon.Charging,バッテリー {0}% — 充電中 BatteryIcon.Discharging,バッテリー {0}% -BatteryIcon.Full,バッテリー 満充電 \ No newline at end of file +BatteryIcon.Full,バッテリー 満充電 +Close.ConfirmPowerOff,タブレットの電源を切ります。よろしいですか? +Close.ShuttingDown,シャットダウン中... +Common.Cancel,キャンセル +Common.PowerOff,電源を切る \ No newline at end of file diff --git a/program/touch_friendly.css b/program/touch_friendly.css index 0c4851a..fbcd824 100644 --- a/program/touch_friendly.css +++ b/program/touch_friendly.css @@ -210,4 +210,44 @@ margin: 8px 40px; } /* #BatteryLabel { margin-left: 4px; } */ -#BatteryLabel.battery-low { color: #c62828; font-weight: bold; } \ No newline at end of file +#BatteryLabel.battery-low { color: #c62828; font-weight: bold; } + +/* ---------- power-off confirmation ---------- */ +/* Own toplevel, so the generic `window` and `button` rules at the top of + this file apply to it. Undo both, then restyle from scratch. */ +#PowerOffDialog { + background-image: none; + background-color: #FFFFFF; + border: 4px solid #0B3B6B; +} +#PowerOffDialog box, +#PowerOffDialog .dialog-vbox, +#PowerOffDialog .dialog-action-area { + background-color: transparent; + background-image: none; +} + +#PowerOffMessage { + font-family: 'Noto Sans JP', 'IPAPGothic', 'Noto Sans', sans-serif; + font-size: 40px; + font-weight: 700; + color: #1e1e1e; + margin: 44px 40px 28px 40px; +} + +#PowerOffDialog button { + min-height: 90px; + min-width: 280px; + margin: 0 20px 30px 20px; + border: 2px solid rgba(0,0,0,0.45); + border-radius: 0; +} +#PowerOffDialog button label { font-size: 34px; color: #ffffff; } + +#PowerOffCancel { background-color: #808080; } +#PowerOffCancel:hover { background-color: #909090; } +#PowerOffCancel:active { background-color: #6E6E6E; } + +#PowerOffConfirm { background-color: #C62828; } +#PowerOffConfirm:hover { background-color: #D33A3A; } +#PowerOffConfirm:active { background-color: #A61F1F; } \ No newline at end of file